gnu.crypto.key
Class GnuSecretKey
- Key
public class GnuSecretKey
implements Key
A secret key composed of a sequence of raw, unformatted octets. This class
is analogous to the
SecretKeySpec
class, but is
provided for platforms that do not or cannot contain that class.
GnuSecretKey(byte[] key, String algorithm) - Creates a new secret key.
|
GnuSecretKey(byte[] key, int offset, int length, String algorithm) - Creates a new secret key from a portion of a byte array.
|
boolean | equals(Object o)
|
String | getAlgorithm() - Returns the algorithm name, if any.
|
byte[] | getEncoded() - Returns the encoded key, which is merely the byte array this class was
created with.
|
String | getFormat() - Returns the string "RAW".
|
String | toString()
|
GnuSecretKey
public GnuSecretKey(byte[] key,
String algorithm)
Creates a new secret key. The supplied byte array is copied by this
constructor.
key
- The raw, secret key.algorithm
- The algorithm name, which can be null or empty.
GnuSecretKey
public GnuSecretKey(byte[] key,
int offset,
int length,
String algorithm)
Creates a new secret key from a portion of a byte array.
key
- The raw, secret key.offset
- The offset at which the key begins.length
- The number of bytes that comprise the key.algorithm
- The algorithm name, which can be null or empty.
equals
public boolean equals(Object o)
getAlgorithm
public String getAlgorithm()
Returns the algorithm name, if any.
getEncoded
public byte[] getEncoded()
Returns the encoded key, which is merely the byte array this class was
created with. A reference to the internal byte array is returned, so the
caller can delete this key from memory by modifying the returned array.
getFormat
public String getFormat()
Returns the string "RAW".
toString
public String toString()
Copyright © 2001, 2002, 2003
Free Software Foundation,
Inc. All Rights Reserved.