Examples of JCECrypto


Examples of org.jclouds.encryption.internal.JCECrypto

         "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

Examples of org.jclouds.encryption.internal.JCECrypto

   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 = ByteStreams.toByteArray(new RSAEncryptingPayload(new JCECrypto(), Payloads.newPayload("fooya"), user
            .getCertificate().getPublicKey()));

      assertEquals(
            ByteStreams.toByteArray(new RSADecryptingPayload(new JCECrypto(), Payloads.newPayload(encrypted), user.getPrivateKey())),
            "fooya".getBytes());

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

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

Examples of org.jclouds.encryption.internal.JCECrypto

      String auth = "AWS4-HMAC-SHA256 " + "Credential=AKIAIOSFODNN7EXAMPLE/20120525/us-east-1/glacier/aws4_request,"
            + "SignedHeaders=host;x-amz-date;x-amz-glacier-version,"
            + "Signature=3ce5b2f2fffac9262b4da9256f8d086b4aaf42eba5f111c21681a65a127b7c2a";
      String identity = "AKIAIOSFODNN7EXAMPLE";
      String credential = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY";
      AWSRequestSignerV4 signer = new AWSRequestSignerV4(identity, credential, new JCECrypto());
      HttpRequest request = signer.sign(createRequest());
      assertThat(request.getFirstHeaderOrNull("Authorization")).isEqualTo(auth);
   }
View Full Code Here

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

Examples of org.jclouds.encryption.internal.JCECrypto

   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

Examples of org.jclouds.encryption.internal.JCECrypto

   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.getPassword(), "u4.y9mb;nR.");
View Full Code Here

Examples of org.jclouds.encryption.internal.JCECrypto

         "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

Examples of org.jclouds.encryption.internal.JCECrypto

   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

Examples of org.jclouds.encryption.internal.JCECrypto

   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.getPassword(), "u4.y9mb;nR.");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.