Class PKCS12KeyWithParameters

java.lang.Object
org.bouncycastle.jcajce.PKCS12Key
org.bouncycastle.jcajce.PKCS12KeyWithParameters
All Implemented Interfaces:
Serializable, Key, PBEKey, SecretKey, Destroyable, PBKDFKey

public class PKCS12KeyWithParameters extends PKCS12Key implements PBEKey
A password based key for use with PKCS#12 with full PBE parameters.
See Also:
  • Constructor Details

    • PKCS12KeyWithParameters

      public PKCS12KeyWithParameters(char[] password, byte[] salt, int iterationCount)
      Basic constructor for a password based key with generation parameters.
      Parameters:
      password - password to use.
      salt - salt for generation algorithm
      iterationCount - iteration count for generation algorithm.
    • PKCS12KeyWithParameters

      public PKCS12KeyWithParameters(char[] password, boolean useWrongZeroLengthConversion, byte[] salt, int iterationCount)
      Basic constructor for a password based key with generation parameters, specifying the wrong conversion for zero length passwords.
      Parameters:
      password - password to use.
      salt - salt for generation algorithm
      iterationCount - iteration count for generation algorithm.
      useWrongZeroLengthConversion - use the incorrect encoding approach (add pad bytes)
  • Method Details

    • getSalt

      public byte[] getSalt()
      Return the salt to use in the key derivation function.
      Specified by:
      getSalt in interface PBEKey
      Returns:
      the salt to use in the KDF.
    • getIterationCount

      public int getIterationCount()
      Return the iteration count to use in the key derivation function.
      Specified by:
      getIterationCount in interface PBEKey
      Returns:
      the iteration count to use in the KDF.