Examples of decrypt()


Examples of org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt()

        //decrypt the password
        StandardPBEByteEncryptor encryptor = new StandardPBEByteEncryptor();
        char[] key = key();
        try {
            encryptor.setPasswordCharArray(key);
            return encryptor.decrypt(Base64.decodeBase64(passwd));
        }
        finally {
            scramble(key);
        }
View Full Code Here

Examples of org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt()

   */
  public static String decryptString(String cypher, String password) {

    StandardPBEStringEncryptor encryptor = initCypher();
    encryptor.setPassword(password);
    String output = encryptor.decrypt(cypher);
    return output;
  }

  /**
   * Encrypt a plaintext with the given password. The password will be treated
View Full Code Here

Examples of org.jasypt.intf.service.JasyptStatelessService.decrypt()

            String input = argumentValues.getProperty(ArgumentNaming.ARG_INPUT);

            CLIUtils.showArgumentDescription(argumentValues, verbose);
           
            String result =
                service.decrypt(
                        input,
                        argumentValues.getProperty(ArgumentNaming.ARG_PASSWORD),
                        null,
                        null,
                        argumentValues.getProperty(ArgumentNaming.ARG_ALGORITHM),
View Full Code Here

Examples of org.jasypt.util.binary.BasicBinaryEncryptor.decrypt()

      // Set password to use
      be.setPassword(PASSWORD_FOR_ENCRYPTION);
      // Encrypt data. By default the algorithm used is PBEWithMD5AndDES
      byte[] encryptedData = be.encrypt(data);
      // Valid "encrypted" data
      byte[] decryptedData = be.decrypt(encryptedData);
      Assert.assertArrayEquals(data, decryptedData);
      // Create a image file with the decrypted data in order to validate
      // that data are not corrupted
      File f = File.createTempFile("JASYPT", ".png");
      fos = new FileOutputStream(f);
View Full Code Here

Examples of org.jasypt.util.binary.StrongBinaryEncryptor.decrypt()

      be.setPassword(PASSWORD_FOR_ENCRYPTION);
      // Encrypt data. By default the algorithm used is
      // PBEWithMD5AndTripleDES
      byte[] encryptedData = be.encrypt(data);
      // Valid "encrypted" data
      byte[] decryptedData = be.decrypt(encryptedData);
      Assert.assertArrayEquals(data, decryptedData);
      // Create a image file with the decrypted data in order to validate
      // that data are not corrupted
      File f = File.createTempFile("JASYPT", ".png");
      fos = new FileOutputStream(f);
View Full Code Here

Examples of org.jasypt.util.text.BasicTextEncryptor.decrypt()

    te.setPassword(PASSWORD_FOR_ENCRYPTION);
    // Encrypt text. By default the algorithm used is PBEWithMD5AndDES
    String encryptedText = te.encrypt(TEXT_TO_ENCRYPT);
    System.out.printf("testTextEncryptionUsingBasicTextEncryptor : '%s' become '%s'\n", TEXT_TO_ENCRYPT, encryptedText);
    // Valid "encrypted" text
    Assert.assertEquals(te.decrypt(encryptedText), TEXT_TO_ENCRYPT);
  }

  /**
   * This test show how encrypt a text using a strong encryptor (using
   * symetric key)
View Full Code Here

Examples of org.jasypt.util.text.StrongTextEncryptor.decrypt()

    te.setPassword(PASSWORD_FOR_ENCRYPTION);
    // Encrypt text. By default the algorithm used is PBEWithMD5AndTripleDES
    String encryptedText = te.encrypt(TEXT_TO_ENCRYPT);
    System.out.printf("testTextEncryptionUsingStrongTextEncryptor : '%s' become '%s'\n", TEXT_TO_ENCRYPT, encryptedText);
    // Valid "encrypted" text
    Assert.assertEquals(te.decrypt(encryptedText), TEXT_TO_ENCRYPT);
  }

  /**
   * This test show how encrypt a binary data using a basic encryptor (using
   * symetric key)
View Full Code Here

Examples of org.jboss.resteasy.jose.jwe.JWEInput.decrypt()

            Link next = response.getLink("next");
            String message = response.readEntity(String.class);
            try
            {
               JWEInput encrypted = new JWEInput(message);
               message = encrypted.decrypt(secret).readContent(String.class);
            }
            catch (Exception ignore)
            {
               //e.printStackTrace();
            }
View Full Code Here

Examples of org.jboss.shrinkwrap.resolver.impl.maven.internal.decrypt.MavenSettingsDecrypter.decrypt()

            securitySettings = new File(altSecuritySettings);
        }

        SettingsDecrypter decrypter = new MavenSettingsDecrypter(securitySettings);
        SettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest(settings);
        SettingsDecryptionResult result = decrypter.decrypt(request);

        if (result.getProblems().size() > 0) {
            StringBuilder sb = new StringBuilder("Found ").append(result.getProblems().size())
                    .append(" problems while trying to decrypt settings configuration.");
View Full Code Here

Examples of org.jitterbit.crypto.pgp.FileDecryptor.decrypt()

        FileDecryptor dec = new FileDecryptor(BouncyCastlePgpProvider.getInstance().getDecryptor());
        File output = new File(root, "output");
        Key decryptionKey = new FileBasedKey(new File(root, "receiver\\secring.gpg"));
        Key verificationKey = new FileBasedKey(new File(root, "sender\\pubring.gpg"));
        dec.setVerificationKey(verificationKey);
        FileDecryptionResult res = dec.decrypt(signedAndEncryptedMessage, output, decryptionKey, "receiver".toCharArray());
        System.out.println(res.authenticationStatus());
        if (res.authenticationStatus() != MessageAuthenticationStatus.AUTHENTICATION_VERIFIED) {
            System.err.println("Fake sender! Danger, Will Robinson!");
        }
    }
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.