|
Oracle Security Developer Tools Crypto FIPS Java API Reference 11g (11.1.1) E10696-02 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Key
An interface for a key, which may be used for encryption or decryption, for generating or verifying signatures, or for generating or verifying MACs.
A key may be a private key, a public key, or a symmetric key.
The code using this API is responsible for erasing any keys it has to when it is done with them to prevent leakage of sensitive key material.
PrivateKey, PublicKey, SymmetricKey| Method Summary | |
|---|---|
java.lang.Object |
clone()Performs a deep clone of the Key instance. |
void |
erase()Erases the sensitive key material of a private or symmetric key, making the key un-usable. |
java.lang.String |
getAlgorithm()Returns the algorithm for which this key is primarily used. |
boolean |
getAllowExport()If false, this key's material may not be exported in plaintext; if true, and if the global export flag is true, the key's material may be exported in plaintext. |
int |
getBitLength()Returns the number of bits required to represent this key's defining key material. |
byte[] |
getEncoded()Returns the encoded form of this key. |
java.lang.String |
getFormat()Returns the format of this key's encoded form. |
| Methods inherited from interface java.io.Externalizable |
|---|
readExternal, writeExternal |
| Method Detail |
|---|
java.lang.String getAlgorithm()
java.lang.String getFormat()
byte[] getEncoded()
int getBitLength()
void erase()
Note: After erase() has been invoked, no other methods of the Key object are guaranteed to function correctly. In particular, invoking another method after erase() may result in a NullPointerException being thrown.
java.lang.Object clone()
boolean getAllowExport()
false, this key's material may not be exported in plaintext; if true, and if the global export flag is true, the key's material may be exported in plaintext.
If plaintext export is not allowed, the key's output methods, such as getEncoded() will throw a KeyExportException.
FIPS_140_2.getAllowKeyExport(), Cipher.wrapKey(oracle.security.crypto.core.PrivateKey)
|
Oracle Security Developer Tools Crypto FIPS Java API Reference 11g (11.1.1) E10696-02 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||