de.flexiprovider.core.kdf
Class PBKDF2Parameters
java.lang.Object
|
+--java.security.AlgorithmParametersSpi
|
+--de.flexiprovider.api.parameters.AlgorithmParameters
|
+--de.flexiprovider.core.kdf.PBKDF2Parameters
- public class PBKDF2Parameters
- extends AlgorithmParameters
This class represents parameters for the default key derivation function (OID
1.2.840.113549.2.7) for the passphrase based encryption.
- Author:
- Thomas Wahrenbruch, Martin Döring
|
Field Summary |
static java.lang.String |
OID
The OID of PBKDF2. |
|
Method Summary |
byte[] |
getEncoded()
Return the parameters encoded in their primary encoding format. |
byte[] |
getEncoded(java.lang.String format)
Return the parameters encoded in the specified encoding format. |
AlgorithmParameterSpec |
getParameterSpec(java.lang.Class paramSpec)
Return a transparent specification of the parameters. |
void |
init(AlgorithmParameterSpec params)
Initialize the parameters with the given parameter specification. |
void |
init(byte[] encParams)
Import the specified parameters and decode them according to the primary
decoding format (ASN.1) for parameters. |
void |
init(byte[] encParams,
java.lang.String format)
Import the specified parameters and decode them according to the
specified decoding format. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OID
public static final java.lang.String OID
- The OID of PBKDF2.
PBKDF2Parameters
public PBKDF2Parameters()
init
public void init(AlgorithmParameterSpec params)
throws InvalidParameterSpecException
- Initialize the parameters with the given parameter specification.
Currently, only
PBKDF2ParameterSpec is supported as specification
type.
- Overrides:
init in class AlgorithmParameters
- Parameters:
params - the parameter specification- Throws:
InvalidParameterSpecException - if the parameter specification is not an instance of
PBKDF2ParameterSpec.
init
public void init(byte[] encParams)
throws java.io.IOException
- Import the specified parameters and decode them according to the primary
decoding format (ASN.1) for parameters.
- Overrides:
init in class AlgorithmParameters
- Parameters:
encParams - the encoded parameters- Throws:
java.io.IOException - on decoding errors.
init
public void init(byte[] encParams,
java.lang.String format)
throws java.io.IOException
- Import the specified parameters and decode them according to the
specified decoding format. Currently, only the primary decoding format
("ASN.1") is supported.
- Overrides:
init in class AlgorithmParameters
- Parameters:
encParams - the encoded parametersformat - the decoding format- Throws:
java.io.IOException - on decoding errors or if the encoding format is
unsupported.
getEncoded
public byte[] getEncoded()
throws java.io.IOException
- Return the parameters encoded in their primary encoding format. The
primary encoding format for parameters is ASN.1.
- Overrides:
getEncoded in class AlgorithmParameters
- Returns:
- the encoded parameters
- Throws:
java.io.IOException - on encoding errors.
getEncoded
public byte[] getEncoded(java.lang.String format)
throws java.io.IOException
- Return the parameters encoded in the specified encoding format.
Currently, only the primary encoding format ("ASN.1") is supported.
- Overrides:
getEncoded in class AlgorithmParameters
- Parameters:
format - the decoding format- Returns:
- the encoded parameters
- Throws:
java.io.IOException - on encoding errors or if the encoding format is
unsupported.
getParameterSpec
public AlgorithmParameterSpec getParameterSpec(java.lang.Class paramSpec)
throws InvalidParameterSpecException
- Return a transparent specification of the parameters. Currently, only
PBKDF2ParameterSpec is supported as specification type.
- Overrides:
getParameterSpec in class AlgorithmParameters
- Parameters:
paramSpec - the desired parameter specification type- Returns:
- the parameter specification
- Throws:
InvalidParameterSpecException - if the parameter specification type is not assignable
from PBKDF2ParameterSpec.
toString
public java.lang.String toString()
- Overrides:
toString in class AlgorithmParameters
- Returns:
- a human readable form of the parameters