September 2002
Intermediate to advanced
416 pages
14h 46m
English
SecretKey
This class implements a secret key (that
is, one used for DES or RC4 encryption, though the standard package
supports only RC4 keys). Secret keys are obtained through the
KeyBuilder class; once such a key is obtained, you
must initialize it by passing a random set of bytes to the
setKey( ) method. The random bytes should be
generated by a secure random number generator, such as the
JRandom class. The length of the array of a random
byte should be KeyBuilder.LENGTH_RC4 . Because you
are required to perform this initialization, this class is commonly
used.
public final class SecretKey implements jxta.security.cipher.Key { // Public Constructors public SecretKey(byte type, short len); // Public Instance Methods public byte getKey(byte[ ] buf, int off); public void setKey(byte[ ] buf, int off) throws jxta.security.exceptions.CryptoException; // Methods Implementing Key public void clearKey(); public int getLength(); public short getSize(); public byte getType(); public boolean isInitialized(); }
Read now
Unlock full access