|
Oracle Security Developer Tools Crypto Java API Reference 10g (10.1.4.0.1) B28171-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.crypto.core.SymmetricKey
An encryption/decryption key used by a symmetric cipher.
Constructor Summary | |
SymmetricKey() Creates a new symmetric key. |
|
SymmetricKey(byte[] key) Creates a new symmetric key with the given key material. |
|
SymmetricKey(byte[] key, AlgorithmIdentifier algID) |
|
SymmetricKey(byte[] key, java.lang.String alg) Deprecated. |
Method Summary | |
java.lang.Object |
clone() Creates a deep copy of this SymmetricKey instance. |
boolean |
equals(java.lang.Object o) A shallow equals method that simply compares the key material of two SymmetricKey instances for equality. |
void |
erase() Erases the key material making the key un-usable. |
void |
finalize() Erases this object prior to being reclaimed by the garbage collector. |
AlgorithmIdentifier |
getAlgID() |
java.lang.String |
getAlgorithm() Deprecated. |
int |
getBitLength() Returns the number of bits required to represent the byte array wrapped by the SymmetricKey instance. |
byte[] |
getBytes() Returns the encoded key. |
byte[] |
getEncoded() Returns the encoded key. |
java.lang.String |
getFormat() Returns the format used in this key's encoding. |
int |
keySize() Returns the length of the key in bytes. |
void |
setAlgID(AlgorithmIdentifier algID) |
void |
setBytes(byte[] key) Sets the actual bytes of the key. |
java.lang.String |
toString() |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SymmetricKey(byte[] key, java.lang.String alg)
public SymmetricKey(byte[] key, AlgorithmIdentifier algID)
public SymmetricKey(byte[] key)
public SymmetricKey()
setBytes
to define the key material.Method Detail |
public java.lang.String getAlgorithm()
getAlgorithm
in interface Key
public AlgorithmIdentifier getAlgID()
public void setAlgID(AlgorithmIdentifier algID)
public int keySize()
public void setBytes(byte[] key)
public byte[] getBytes()
public byte[] getEncoded()
getEncoded
in interface Key
public int getBitLength()
This will always be 8 * the number of bytes in the key array or 0 if the array is null.
getBitLength
in interface Key
public java.lang.String getFormat()
getFormat
in interface Key
public boolean equals(java.lang.Object o)
public void erase()
Keys can be erased multiple times with no consequence.
erase
in interface Key
public void finalize()
Note: There is no guarantee of when, if ever, finalize
will be invoked by the Java runtime.
public java.lang.String toString()
public java.lang.Object clone()
SymmetricKey
instance.clone
in interface Key
|
Oracle Security Developer Tools Crypto Java API Reference 10g (10.1.4.0.1) B28171-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |