Package org.bouncycastle.pkcs.bc
Class BcPKCS12PBEOutputEncryptorBuilder
- java.lang.Object
-
- org.bouncycastle.pkcs.bc.BcPKCS12PBEOutputEncryptorBuilder
-
public class BcPKCS12PBEOutputEncryptorBuilder extends java.lang.ObjectLightweight builder for anOutputEncryptorthat applies one of the PKCS#12 password-based encryption schemes from RFC 7292 Appendix C. Defaults to SHA-1 as the KDF digest with an iteration count of 1024.
-
-
Constructor Summary
Constructors Constructor Description BcPKCS12PBEOutputEncryptorBuilder(org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm, org.bouncycastle.crypto.BlockCipher engine)Build an encryptor for the given PKCS#12 PBE algorithm using SHA-1 as the KDF digest.BcPKCS12PBEOutputEncryptorBuilder(org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm, org.bouncycastle.crypto.BlockCipher engine, org.bouncycastle.crypto.ExtendedDigest pbeDigest)Build an encryptor for the given PKCS#12 PBE algorithm and an explicit KDF digest.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutputEncryptorbuild(char[] password)Bind the builder to a password and return a configuredOutputEncryptor.BcPKCS12PBEOutputEncryptorBuildersetIterationCount(int iterationCount)Override the iteration count used by the PKCS#12 KDF.
-
-
-
Constructor Detail
-
BcPKCS12PBEOutputEncryptorBuilder
public BcPKCS12PBEOutputEncryptorBuilder(org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm, org.bouncycastle.crypto.BlockCipher engine)Build an encryptor for the given PKCS#12 PBE algorithm using SHA-1 as the KDF digest.- Parameters:
algorithm- the PKCS#12 PBE algorithm identifier.engine- the underlying block cipher to wrap with PKCS#7 padding.
-
BcPKCS12PBEOutputEncryptorBuilder
public BcPKCS12PBEOutputEncryptorBuilder(org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm, org.bouncycastle.crypto.BlockCipher engine, org.bouncycastle.crypto.ExtendedDigest pbeDigest)Build an encryptor for the given PKCS#12 PBE algorithm and an explicit KDF digest.- Parameters:
algorithm- the PKCS#12 PBE algorithm identifier.engine- the underlying block cipher to wrap with PKCS#7 padding.pbeDigest- the digest to use inside the PKCS#12 KDF.
-
-
Method Detail
-
setIterationCount
public BcPKCS12PBEOutputEncryptorBuilder setIterationCount(int iterationCount)
Override the iteration count used by the PKCS#12 KDF. Defaults to 1024.- Parameters:
iterationCount- the iteration count.- Returns:
- this builder.
-
build
public OutputEncryptor build(char[] password)
Bind the builder to a password and return a configuredOutputEncryptor.- Parameters:
password- the password used to derive the encryption key.- Returns:
- an output encryptor parameterised with a freshly generated salt and the configured iteration count.
-
-