Class JcePKCSPBEOutputEncryptorBuilder

java.lang.Object
org.bouncycastle.pkcs.jcajce.JcePKCSPBEOutputEncryptorBuilder

public class JcePKCSPBEOutputEncryptorBuilder extends Object
JCA-based builder for an OutputEncryptor that applies one of the password-based encryption schemes used to protect PKCS#8 / PKCS#12 payloads:
  • the legacy PKCS#12 pkcs-12PbeIds family (RFC 7292 Appendix C) — selected when the constructor is passed one of those OIDs,
  • PBES2 (RFC 8018) — selected for any other key-encryption algorithm; the embedded key-derivation function may be PBKDF2 or scrypt (RFC 7914) via an explicit PBKDFConfig.
  • Constructor Details

    • JcePKCSPBEOutputEncryptorBuilder

      public JcePKCSPBEOutputEncryptorBuilder(org.bouncycastle.asn1.ASN1ObjectIdentifier keyEncryptionAlg)
      Construct a builder for a single algorithm. If keyEncryptionAlg is a PKCS#12 PBE OID, the resulting encryptor uses the PKCS#12 wire profile; otherwise the encryptor uses PBES2 with the default PBKDF2 configuration and keyEncryptionAlg as the underlying encryption scheme.
      Parameters:
      keyEncryptionAlg - the algorithm identifier the encryptor should apply.
    • JcePKCSPBEOutputEncryptorBuilder

      public JcePKCSPBEOutputEncryptorBuilder(org.bouncycastle.crypto.util.PBKDFConfig pbkdfAlgorithm, org.bouncycastle.asn1.ASN1ObjectIdentifier keyEncryptionAlg)
      Constructor allowing different derivation functions such as PBKDF2 and scrypt.
      Parameters:
      pbkdfAlgorithm - key derivation algorithm definition to use.
      keyEncryptionAlg - encryption algorithm to apply the derived key with.
  • Method Details