|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.security.AlgorithmParametersSpi | +--iaik.security.pbe.PBEParameters
This class represents PBE paramters in opaque form and may be used for generating opaque PBE parameters and converting them between various formats.
RSA-PKCS#5 describes a method for encrypting messages (octet strings) with secret keys derived from a password. For generating the key from the password, paramters (salt a random octet string and iteration count an integer) are required.
PBEParamters can be generated provider independently by calling one of the
AlgorithmParameters.getInstance
methods. Subsequently
the new AlgorithmParamters object must be initialized with a proper PBE parameter specification or
a DER encoded byte array. If the first way is chosen, the parameter values
(salt and iteration count) for initializing the new AlgorithmParameters object
are immediately taken from the given PBE parameter specification; if the
parameters are given as DER encoded byte array, an ASN.1 object is created
from this byte array for subsequently parsing it to get salt and iteration count.
Alternatively PBEParamerters may be created by using a proper AlgorithmParamterGenerator. The PBEParameterGenerator itself calls
for actually generating PBEParameters in opaque representation.AlgorithmParameters.getInstance("PBE", "IAIK")
For obtaining PBE parameters in transparent representation from an opaque
PBEParamters object, the getParameterSpec
method can be used;
for obtaining the parameters as DER encoded ASN.1 object, use
getEncoded
.
PBEParameterGenerator
,
PBEGenParameterSpec
,
AlgorithmParameters
Constructor Summary | |
PBEParameters()
The default constructor. |
Method Summary | |
protected byte[] |
engineGetEncoded()
Returns the parameters as DER byte array. |
protected byte[] |
engineGetEncoded(String format)
Returns the parameters as a DER byte array. |
protected AlgorithmParameterSpec |
engineGetParameterSpec(Class paramSpec)
Returns the PBE parameters as transparent PBE parameter specification of the given class type. |
protected void |
engineInit(AlgorithmParameterSpec paramSpec)
Initializes this PBEParameters with salt and iteration count from a given PBEParameterSpec or PBEKeyAndParameterSpec. |
protected void |
engineInit(byte[] params)
Initializes this PBEParameters object from the given DER encoded byte array. |
protected void |
engineInit(byte[] params,
String format)
Inits the parameters from an DER encoded byte array. |
protected String |
engineToString()
Returns a String representation of the parameters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PBEParameters()
PBEParameters
object.
Applications shall use one of the AlgorithmParameters.getInstance
factory methods for obtaining PBEParameters.Method Detail |
protected byte[] engineGetEncoded() throws IOException
A SEQUENCE
ASN.1 object is created for holding salt and
iteration count; subsequently this SEQUENCE object is DER-encoded to
get the required byte array.
engineGetEncoded
in class AlgorithmParametersSpi
IOException
- if an encoding error occursprotected byte[] engineGetEncoded(String format) throws IOException
Format is ignored. Only DER encoding is supported at this time. This method
only calls engineGetEncoded()
for returning the PBE paramters as DER encoded byte array, regardless of what
is specified in the format
string.
engineGetEncoded
in class AlgorithmParametersSpi
format
- the encoding format; ignoredIOException
- if an encoding error occursprotected AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec) throws InvalidParameterSpecException
engineGetParameterSpec
in class AlgorithmParametersSpi
paramSpec
- the desired parameter specification classInvalidParameterSpecException
- if the paramters cannot be converted to
the desired parameter specificationprotected void engineInit(AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException
engineInit
in class AlgorithmParametersSpi
paramSpec
- the parameter specification, which has to be a PBEParameterSpecInvalidParameterSpecException
- if the given parameter specification
is not a PBEParameterSpecprotected void engineInit(byte[] params) throws IOException
From the given byte array a ASN.1 object is created to be parsed for the required salt and iteration count.
engineInit
in class AlgorithmParametersSpi
params
- the DER encoded byte arrayIOException
- if an error occurs when decoding the given byte arrayprotected void engineInit(byte[] params, String format) throws IOException
engineInit(params)
for initializing this PBEParamters object from
the given DER encoded byte array, regardless of what is specified in the format
string.engineInit
in class AlgorithmParametersSpi
params
- the DER encoded byte arrayformat
- the encoding format; ignoredIOException
- if an error occurs when decoding the given byte arrayprotected String engineToString()
engineToString
in class AlgorithmParametersSpi
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |