Class JcePKCSPBEInputDecryptorProviderBuilder
java.lang.Object
org.bouncycastle.pkcs.jcajce.JcePKCSPBEInputDecryptorProviderBuilder
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild(char[] password) Bind the builder to a password and return anInputDecryptorProviderthat can produce decryptors for the password-based algorithm identifiers it is asked for.setKeySizeProvider(SecretKeySizeProvider keySizeProvider) Set the lookup provider of AlgorithmIdentifier returning key_size_in_bits used to handle PKCS5 decryption.setProvider(String providerName) setProvider(Provider provider) 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.
-
Constructor Details
-
JcePKCSPBEInputDecryptorProviderBuilder
public JcePKCSPBEInputDecryptorProviderBuilder()Base constructor.
-
-
Method Details
-
setProvider
-
setProvider
-
setTryWrongPKCS12Zero
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-trueto 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
Bind the builder to a password and return anInputDecryptorProviderthat 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.
-