Package org.bouncycastle.jcajce
Class PBKDF2Key
- java.lang.Object
-
- org.bouncycastle.jcajce.PBKDF2Key
-
- All Implemented Interfaces:
java.io.Serializable
,java.security.Key
,javax.crypto.SecretKey
,javax.security.auth.Destroyable
,PBKDFKey
- Direct Known Subclasses:
PBKDF2KeyWithParameters
public class PBKDF2Key extends java.lang.Object implements PBKDFKey
A password based key for use with PBKDF2 as defined in PKCS#5.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PBKDF2Key(char[] password, CharToByteConverter converter)
Basic constructor for a password based key using PBKDF - secret key generation parameters will be passed separately..
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
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 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 interfacejava.security.Key
- Returns:
- the string "PBKDF2"
-
getFormat
public java.lang.String getFormat()
Return the format encoding.- Specified by:
getFormat
in interfacejava.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 interfacejava.security.Key
- Returns:
- the password converted to a byte array.
-
-