| java.lang.Object com.sun.portal.ksecurity.RSAKey
Field Summary | |
short | bitsize Key size in bits, e.g. | byte[] | exp Local variable to hold the exponent. | boolean | initOk Flag to indicate the key has been initialized. | byte | kind Type of key, e.g. | byte[] | mod The number of bytes allocated to the modulus
is always a multiple of 8. |
Constructor Summary | |
| RSAKey(byte type, short len) Constructor for RSA public or private key. |
Method Summary | |
public void | clearKey() Clear the current key. | public boolean | equals(RSAPrivateKey k) Compare the current key as a RSA private key. | public boolean | equals(RSAPublicKey k) Compare the current key as a RSA public key. | public boolean | equals(RSAKey k) Compare the current key as a generic RSA key. | public short | getExponent(byte[] buf, short off) Get the exponent for the key. | public short | getModulus(byte[] buf, short off) Get the modulus for the key. | public short | getSize() Get the size of the current key. | public byte | getType() Get the type of the current key. | public boolean | isInitialized() Check if the key has been initialized. | public void | setExponent(byte[] buf, short off, short len) Set the exponent for the key. | public void | setModulus(byte[] buf, short off, short len) Set the modulus for the key. | public String | toString() Convert the key to a readable string. |
bitsize | short bitsize(Code) | | Key size in bits, e.g. for RSA, this is modulus size.
|
exp | byte[] exp(Code) | | Local variable to hold the exponent.
|
initOk | boolean initOk(Code) | | Flag to indicate the key has been initialized.
|
kind | byte kind(Code) | | Type of key, e.g. DES, RSA etc.
|
mod | byte[] mod(Code) | | The number of bytes allocated to the modulus
is always a multiple of 8.
|
RSAKey | RSAKey(byte type, short len)(Code) | | Constructor for RSA public or private key.
Parameters: type - of key to process Parameters: len - length of the key |
clearKey | public void clearKey()(Code) | | Clear the current key.
|
equals | public boolean equals(RSAPrivateKey k)(Code) | | Compare the current key as a RSA private key.
Parameters: k - the key to compare true if the kesy are the same. |
equals | public boolean equals(RSAPublicKey k)(Code) | | Compare the current key as a RSA public key.
Parameters: k - the key to compare true if the keys are the same. |
equals | public boolean equals(RSAKey k)(Code) | | Compare the current key as a generic RSA key.
Parameters: k - the key to compare true if the keys are the same. |
getExponent | public short getExponent(byte[] buf, short off)(Code) | | Get the exponent for the key.
Parameters: buf - output buffer to hold the exponent Parameters: off - offset in the buffer to copy the exponent length of the data copied See Also: RSAKey.setExponent |
getModulus | public short getModulus(byte[] buf, short off)(Code) | | Get the modulus for the key.
Parameters: buf - output buffer to hold the modulus Parameters: off - offset in the buffer to copy the modulus length of the data copied See Also: RSAKey.setModulus |
getSize | public short getSize()(Code) | | Get the size of the current key.
length of the key |
getType | public byte getType()(Code) | | Get the type of the current key.
the type of the key |
isInitialized | public boolean isInitialized()(Code) | | Check if the key has been initialized.
true if the key has been initialized. |
setExponent | public void setExponent(byte[] buf, short off, short len) throws CryptoException(Code) | | Set the exponent for the key.
Parameters: buf - input buffer which hold the exponent Parameters: off - offset in the buffer Parameters: len - length of the data to be copied See Also: RSAKey.getExponent |
setModulus | public void setModulus(byte[] buf, short off, short len) throws CryptoException(Code) | | Set the modulus for the key.
Parameters: buf - input buffer which hold the modulus Parameters: off - offset in the buffer Parameters: len - length of the data to be copied See Also: RSAKey.getModulus |
toString | public String toString()(Code) | | Convert the key to a readable string.
string representation of key |
|
|