Class PBKDF2Key

java.lang.Object
org.bouncycastle.jcajce.PBKDF2Key
All Implemented Interfaces:
Serializable, Key, SecretKey, Destroyable, PBKDFKey
Direct Known Subclasses:
PBKDF2KeyWithParameters

public class PBKDF2Key extends Object implements PBKDFKey
A password based key for use with PBKDF2 as defined in PKCS#5.
See Also:
  • Constructor Details

    • PBKDF2Key

      public PBKDF2Key(char[] password, CharToByteConverter converter)
      Basic constructor for a password based key using PBKDF - secret key generation parameters will be passed separately..
      Parameters:
      password - password to use.
  • Method Details

    • getPassword

      public char[] getPassword()
      Return a reference to the char[] array holding the password.
      Returns:
      a reference to the password array.
    • getAlgorithm

      public String getAlgorithm()
      Return the password based key derivation function this key is for,
      Specified by:
      getAlgorithm in interface Key
      Returns:
      the string "PBKDF2"
    • getFormat

      public String getFormat()
      Return the format encoding.
      Specified by:
      getFormat in interface Key
      Returns:
      the type name representing a char[] to byte[] conversion.
    • getEncoded

      public byte[] getEncoded()
      Return the password converted to bytes.
      Specified by:
      getEncoded in interface Key
      Returns:
      the password converted to a byte array.