PBKDF1Key (Bouncy Castle Library 1.54 API Specification)
Date: 2015-12-29

org.bouncycastle.jcajce

## Class PBKDF1Key

- java.lang.Object
- - org.bouncycastle.jcajce.PBKDF1Key

- All Implemented Interfaces:
    java.io.Serializable, java.security.Key, javax.crypto.SecretKey, PBKDFKey
  Direct Known Subclasses:
    PBKDF1KeyWithParameters

      public class PBKDF1Key
      extends java.lang.Object
      implements PBKDFKey

  A password based key for use with PBKDF1 as defined in PKCS#5.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from interface javax.crypto.SecretKey

      `serialVersionUID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PBKDF1Key(char[] password, CharToByteConverter converter)` Basic constructor for a password based key with generation parameters for PBKDF1.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getAlgorithm()` Return the password based key derivation function this key is for,
    `byte[]` | `getEncoded()` Return the password converted to bytes.
    `java.lang.String` | `getFormat()` Return the format encoding.
    `char[]` | `getPassword()` Return a reference to the char[] array holding the password.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PBKDF1Key

          public PBKDF1Key(char[] password,
                   CharToByteConverter converter)

      Basic constructor for a password based key with generation parameters for PBKDF1.
      Parameters:
        `password` - password to use.
        `converter` - the converter to use to turn the char array into octets.

  - ### Method Detail

    - #### getPassword

          public char[] getPassword()

      Return a reference to the char[] array holding the password.
      Returns:
        a reference to the password array.

    - #### getAlgorithm

          public java.lang.String getAlgorithm()

      Return the password based key derivation function this key is for,
      Specified by:
        `getAlgorithm` in interface `java.security.Key`
      Returns:
        the string "PBKDF1"

    - #### getFormat

          public java.lang.String getFormat()

      Return the format encoding.
      Specified by:
        `getFormat` in interface `java.security.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 `java.security.Key`
      Returns:
        the password converted to a byte array.