| java.lang.Object com.sun.portal.ksecurity.SecretKey
SecretKey | final public class SecretKey implements Key(Code) | | Implements the base interface for keys used in symmetric algorithms.
|
Field Summary | |
short | bitsize Key size in bits, e.g. | boolean | initOk Flag indicating if the key has been initialized. | byte | kind Type of key, e.g. | byte[] | secret Local secret. |
Constructor Summary | |
| SecretKey(byte type, short len) Creates a SecretKey object of the specified type and length. |
Method Summary | |
public void | clearKey() Clears the key and sets it to uninitialized state. | public byte | getKey(byte[] buf, short off) Gets the key data. | public short | getSize() Gets the key size in bits. | public byte | getType() Gets the key type. | public boolean | isInitialized() Checks if the key is initialized. | public void | setKey(byte[] buf, short off) Sets the key data. | public String | toString() Converts the key to its corresponding human readable string
representation. |
bitsize | short bitsize(Code) | | Key size in bits, e.g. for RSA, this is modulus size.
|
initOk | boolean initOk(Code) | | Flag indicating if the key has been initialized.
|
kind | byte kind(Code) | | Type of key, e.g. DES, RSA etc.
|
secret | byte[] secret(Code) | | Local secret.
|
SecretKey | SecretKey(byte type, short len)(Code) | | Creates a SecretKey object of the specified type and length.
Parameters: type - type of the secret key Parameters: len - bit-length of the secret key |
clearKey | public void clearKey()(Code) | | Clears the key and sets it to uninitialized state.
|
getKey | public byte getKey(byte[] buf, short off)(Code) | | Gets the key data. The data format is big-endian and
right-aligned (the least significant bit is the least significant
bit of last byte).
Parameters: buf - the output buffer in which key data is to be placed Parameters: off - starting offset within buf for the key data. number of bytes of key data placed in buf. See Also: SecretKey.setKey |
getSize | public short getSize()(Code) | | Gets the key size in bits.
the key size in bits |
getType | public byte getType()(Code) | | Gets the key type.
the key type |
isInitialized | public boolean isInitialized()(Code) | | Checks if the key is initialized.
true if the key has been initialized, false otherwise |
setKey | public void setKey(byte[] buf, short off) throws CryptoException(Code) | | Sets the key data. The data format is big-endian and
right-aligned (the least significant bit is the least significant
bit of last byte).
Parameters: buf - the input buffer containing key data Parameters: off - starting offset within buf for the key data. exception: CryptoException - with reason code set to ILLEGAL_VALUEif the specified secret data is inconsistent with the key size. See Also: SecretKey.getKey |
toString | public String toString()(Code) | | Converts the key to its corresponding human readable string
representation.
a string representation of the secret key |
|
|