public final class AESSecretKey
extends java.lang.Object
implements javax.crypto.SecretKey
Constructor and Description |
---|
AESSecretKey(byte[] key)
Create a AES key from a given key
|
AESSecretKey(byte[] key,
int offset)
Uses the first 16, 20, or 24 bytes (T) in
key , beginning
at offset , as the AES key. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAlgorithm() |
byte[] |
getEncoded() |
java.lang.String |
getFormat() |
void |
zeroize()
This function zeroizes the key so that it isn't in memory
|
public AESSecretKey(byte[] key) throws java.security.InvalidKeyException
key
- the given keyjava.security.InvalidKeyException
- if the given key has wrong sizepublic AESSecretKey(byte[] key, int offset) throws java.security.InvalidKeyException
key
, beginning
at offset
, as the AES key.key
- the buffer with the AES key bytes.offset
- the offset in key
, where the AES key bytes
start.java.security.InvalidKeyException
- if invalid number of bytes is left for
the key.public byte[] getEncoded()
getEncoded
in interface java.security.Key
public java.lang.String getAlgorithm()
getAlgorithm
in interface java.security.Key
public java.lang.String getFormat()
getFormat
in interface java.security.Key
public void zeroize()
© Portions Copyright 2003, 2012 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2012, Oracle and/or its affiliates. All rights reserved.