Class JcePKCSPBEInputDecryptorProviderBuilder


  • public class JcePKCSPBEInputDecryptorProviderBuilder
    extends java.lang.Object
    JCA-based builder for an InputDecryptorProvider that handles the password-based decryption schemes encountered in PKCS#12 / PKCS#8: the legacy pkcs-12PbeIds family (RFC 7292 Appendix C), PBES2 / PBKDF2 and PBES2 / scrypt (RFC 8018, RFC 7914), and the older PBE1 schemes (pbeWithMD5AndDES-CBC, pbeWithSHA1AndDES-CBC).
    • Constructor Detail

      • JcePKCSPBEInputDecryptorProviderBuilder

        public JcePKCSPBEInputDecryptorProviderBuilder()
        Base constructor.
    • Method Detail

      • setTryWrongPKCS12Zero

        public JcePKCSPBEInputDecryptorProviderBuilder setTryWrongPKCS12Zero​(boolean tryWrong)
        Enable a workaround for older PKCS#12 files that derive the encryption key without applying the trailing zero byte that RFC 7292 requires.
        Parameters:
        tryWrong - true to enable the workaround.
        Returns:
        this builder.
      • setKeySizeProvider

        public JcePKCSPBEInputDecryptorProviderBuilder setKeySizeProvider​(SecretKeySizeProvider keySizeProvider)
        Set the lookup provider of AlgorithmIdentifier returning key_size_in_bits used to handle PKCS5 decryption.
        Parameters:
        keySizeProvider - a provider of integer secret key sizes.
        Returns:
        the current builder.
      • build

        public InputDecryptorProvider build​(char[] password)
        Bind the builder to a password and return an InputDecryptorProvider that can produce decryptors for the password-based algorithm identifiers it is asked for.
        Parameters:
        password - the password used to derive the encryption key.
        Returns:
        a configured decryptor provider.