Class PBKDF2Key
java.lang.Object
org.bouncycastle.jcajce.PBKDF2Key
- All Implemented Interfaces:
Serializable, Key, SecretKey, Destroyable, PBKDFKey
- Direct Known Subclasses:
PBKDF2KeyWithParameters
-
Field Summary
Fields inherited from interface SecretKey
serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionPBKDF2Key(char[] password, CharToByteConverter converter) Basic constructor for a password based key using PBKDF - secret key generation parameters will be passed separately.PBKDF2Key(char[] password, CharToByteConverter converter, AlgorithmIdentifier prf) Constructor for a password based key using PBKDF2 with a given PRF - secret key generation parameters will be passed separately. -
Method Summary
Modifier and TypeMethodDescriptionReturn the password based key derivation function this key is for,byte[]Return the password converted to bytes.Return the format encoding.char[]Return a reference to the char[] array holding the password.getPrf()Return the PRF to use with PBKDF2.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Destroyable
destroy, isDestroyed
-
Constructor Details
-
PBKDF2Key
Basic constructor for a password based key using PBKDF - secret key generation parameters will be passed separately. No PRF is recorded, so a cipher deriving a key from this one uses HMAC-SHA512.- Parameters:
password- password to use.converter- converter to use for turning the password into bytes.
-
PBKDF2Key
Constructor for a password based key using PBKDF2 with a given PRF - secret key generation parameters will be passed separately.- Parameters:
password- password to use.converter- converter to use for turning the password into bytes.prf- the PRF to use with PBKDF2, null if none is specified.
-
-
Method Details
-
getPrf
Return the PRF to use with PBKDF2.- Returns:
- the PRF's AlgorithmIdentifier, null if none was specified.
-
getPassword
public char[] getPassword()Return a reference to the char[] array holding the password.- Returns:
- a reference to the password array.
-
getAlgorithm
Return the password based key derivation function this key is for,- Specified by:
getAlgorithmin interfaceKey- Returns:
- the string "PBKDF2"
-
getFormat
-
getEncoded
public byte[] getEncoded()Return the password converted to bytes.- Specified by:
getEncodedin interfaceKey- Returns:
- the password converted to a byte array.
-