public class NativeSecretKey extends NativeKey implements SecretKey
serialVersionUID| Constructor and Description |
|---|
NativeSecretKey(NativeReference nativeRef,
String algorithm) |
| Modifier and Type | Method and Description |
|---|---|
static NativeSecretKey |
createFromRaw(byte[] rawKey,
String algorithm)
Creates a native secret key from raw key material.
|
void |
destroy()
Destroy this
Object. |
byte[] |
getEncoded()
Returns the key in its primary encoding format, or null if this key does not support encoding.
|
int |
getEncodedMaxSize()
Get the max size of the encoded secret key.
|
String |
getFormat()
Returns the name of the primary encoding format of this key, or null if this key does not support encoding.
|
boolean |
isDestroyed()
Determine if this
Object has been destroyed. |
static int |
nativeGetCloseId()
Gets the id of the native close function.
|
getAlgorithm, getNativeIdclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAlgorithmpublic NativeSecretKey(NativeReference nativeRef, String algorithm)
public static NativeSecretKey createFromRaw(byte[] rawKey, String algorithm)
rawKey - raw key byte arrayalgorithm - algorithm description, for example: "AES"public void destroy()
throws DestroyFailedException
DestroyableObject.
Sensitive information associated with this Object is destroyed or cleared. Subsequent calls to certain
methods on this Object will result in an IllegalStateException being thrown.
The default implementation throws DestroyFailedException.
destroy in interface DestroyableDestroyFailedException - if the destroy operation fails.
public byte[] getEncoded()
KeygetEncoded in interface Keypublic int getEncodedMaxSize()
public String getFormat()
Key"X.509". Similarly, the name of
the ASN.1 data format for private keys is PrivateKeyInfo, as defined by the PKCS #8 standard; in this
case, the returned format is "PKCS#8".public boolean isDestroyed()
DestroyableObject has been destroyed.
The default implementation returns false.
isDestroyed in interface DestroyableObject has been destroyed, false otherwise.public static int nativeGetCloseId()
NativeException - on error