|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The JSAFE_Key class is the generic key interface.
All key objects implement this class, including both symmetric and
asymmetric keys.
See
Overview of Crypto-J for background and reference material
on using and understanding Crypto-J.
Copyright © RSA Security Inc., 1997-2005. All rights reserved.
| Method Summary | |
void |
clearSensitiveData()
This method clears sensitive data from an object. |
getAlgorithm()
Returns the standard name for the algorithm. |
|
getDevice()
Returns the name of the device of record. |
|
byte[][] |
getKeyData()
Gets the key data from the object and returns it in the default format. |
byte[][] |
getKeyData(String format)
Returns a new array of |
getKeyWrappingFormat(boolean ber)
Returns the name of the format to use when getting the data for key wrapping. |
|
int |
getMaximumKeyLength()
Gets the maximum number of bits this key is allowed to have. |
int |
getMinimumKeyLength()
Gets the minimum number of bits this key is allowed to have. |
String[] |
getSupportedGetFormats()
Gets the formats in which this key can return the data. |
String[] |
getSupportedSetFormats()
Gets the formats with which this key may be set. |
void |
setKeyData(byte[][] keyData)
Sets the key to possess the data contained in the |
void |
setKeyData(String format,
byte[][] keyData)
Sets the key with the data contained in the |
| Method Detail |
public String getDevice()
Possible device values are:
public String getAlgorithm()
String giving the standard algorithm name.public int getMaximumKeyLength()
int that is the maximum size, in bits, of the key.public int getMinimumKeyLength()
int that is the minimum size, in bits, of the key.public String[] getSupportedGetFormats()
String array that lists the formats supported
by getKeyData(). The return value can be a zero-length array
if the object does not contain key data. The first element
in the list is the default format.
String array that is the list of valid formats.public String[] getSupportedSetFormats()
String array that lists the formats supported by
setKeyData(). The first element in the list is the
default format.
String array that is the list of valid formats.public String getKeyWrappingFormat(boolean ber)
ber to specify whether the data should
be BER-encoded or not.
ber - A boolean indicating whether the data is wrapped
BER-encoded (true) or not (false).
String that is the format.public byte[][] getKeyData()
byte array containing the key data.public void clearSensitiveData()
clearSensitiveData(),
an Init (not a ReInit) method is
called to perform other operations with the object.
public void setKeyData(String format,
byte[][] keyData)
throws JSAFE_InvalidKeyException,
JSAFE_UnimplementedException
keyData array
of byte arrays in the specified format.
Note: If the format is DSAPublicKeyBER or
DSAPrivateKeyBER,
the resulting key is encoded following the X9.30 standard.
format - A String giving the format in which the data
is returned.keyData - An array of byte arrays holding the key data.
JSAFE_InvalidKeyException - If the key data is not an
appropriate length (above the maximum or below the minimum length).
JSAFE_UnimplementedException - If the object cannot return
the data in the given format.
public byte[][] getKeyData(String format)
throws JSAFE_UnimplementedException
byte arrays that contains the key data
in the given format.
If an object cannot return the data in the specified format,
this method throws an exception.
format - The format in which the data is returned.
byte arrays containing the key data.
JSAFE_UnimplementedException - If the object cannot return
the data in the given format.
public void setKeyData(byte[][] keyData)
throws JSAFE_InvalidKeyException
keyData
array of byte arrays.
The format of keyData is assumed to be the default format.
keyData - An array of byte arrays holding the key data.
JSAFE_InvalidKeyException - If the key data is not an
appropriate length (above the maximum or below the minimum length).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||