Package org.jclouds.encryption.internal

Examples of org.jclouds.encryption.internal.JCECrypto


   *
   * @throws Exception .
   */
  @Test
  public void testDecryptStringWithJCE() throws Exception {
    Crypto crypto = new JCECrypto();
    decryptAndVerify(crypto);

  }
View Full Code Here


         "pQ0LZlQBZDd5/ac0NSoM6tAX3H30pYxNw4t2f9u8aJ48oOEvufgGxTTHnM9qHXD04lt+Ouql6i2q\r\n" +
         "HxBqCxFkMZEla3LFieE=\r\n";

      assertEquals(actual, expected);

      WindowsLoginCredentialsFromEncryptedData passwordDecrypt = new WindowsLoginCredentialsFromEncryptedData(new JCECrypto());

      assertEquals(passwordDecrypt.apply(
         EncryptedPasswordAndPrivateKey.builder().encryptedPassword(actual).privateKey(privateKey).build()).getPassword(), "bX7vvptvw");
   }
View Full Code Here

   protected final DateService dateService = new SimpleDateFormatDateService();

   @Test
   public void testApply() throws Exception {
      WindowsLoginCredentialsFromEncryptedData f = new WindowsLoginCredentialsFromEncryptedData(new JCECrypto());

      LoginCredentials credentials = f.apply(new EncryptedPasswordAndPrivateKey(ENCRYPTED_PASSWORD, PRIVATE_KEY));

      assertEquals(credentials.getUser(), "Administrator");
      assertEquals(credentials.getOptionalPassword().get(), "u4.y9mb;nR.");
View Full Code Here

         "pQ0LZlQBZDd5/ac0NSoM6tAX3H30pYxNw4t2f9u8aJ48oOEvufgGxTTHnM9qHXD04lt+Ouql6i2q\r\n" +
         "HxBqCxFkMZEla3LFieE=\r\n";

      assertEquals(actual, expected);

      WindowsLoginCredentialsFromEncryptedData passwordDecrypt = new WindowsLoginCredentialsFromEncryptedData(new JCECrypto());

      assertEquals(passwordDecrypt.apply(
         EncryptedPasswordAndPrivateKey.builder().encryptedPassword(actual).privateKey(privateKey).build()).getOptionalPassword().get(), "bX7vvptvw");
   }
View Full Code Here

   public void test() throws IOException, CertificateException, NoSuchAlgorithmException {

      Client user = Client.builder().certificate(certificate).orgname("jclouds").clientname("adriancole-jcloudstest")
            .name("adriancole-jcloudstest").isValidator(false).privateKey(privateKey).build();

      byte[] encrypted = ByteStreams2.toByteArrayAndClose(new RSAEncryptingPayload(new JCECrypto(), Payloads.newPayload("fooya"), user
            .getCertificate().getPublicKey()).openStream());

      assertEquals(
            ByteStreams2.toByteArrayAndClose(new RSADecryptingPayload(new JCECrypto(), Payloads.newPayload(encrypted), user.getPrivateKey()).openStream()),
            "fooya".getBytes());

      assertEquals(
            handler.apply(HttpResponse.builder().statusCode(200).message("ok")
                  .payload(ParseClientFromJsonTest.class.getResourceAsStream("/client.json")).build()), user);
View Full Code Here

   protected final DateService dateService = new SimpleDateFormatDateService();

   @Test
   public void testApply() throws Exception {
      WindowsLoginCredentialsFromEncryptedData f = new WindowsLoginCredentialsFromEncryptedData(new JCECrypto());

      PasswordData passwordData = PasswordData.builder()
                                              .instanceId("i-2574e22a")
                                              .timestamp(dateService.iso8601DateParse("2012-07-30T07:27:23.000+0000"))
                                              .passwordData(ENCRYPTED_PASSWORD).build();
View Full Code Here

   *
   * @throws Exception .
   */
  @Test
  public void testDecryptStringWithJCE() throws Exception {
    Crypto crypto = new JCECrypto();
    decryptAndVerify(crypto);

  }
View Full Code Here

TOP

Related Classes of org.jclouds.encryption.internal.JCECrypto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.