|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--iaik.security.cipher.SecretKey
This class represents a secret key as used with symmetric algorithms. Applications generally shall use a proper KeyGenerator for generating the requested Secret Key.
SecretKey,
Key,
KeyGenerator, Serialized Form| Fields inherited from interface java.security.Key |
serialVersionUID |
| Constructor Summary | |
SecretKey(byte[] key,
int off,
int len,
java.lang.String algName)
Creates a SecretKey object from given byte sub-array and algorithm name. |
|
SecretKey(byte[] key,
java.lang.String algName)
Creates a SecretKey object from given byte array and algorithm name. |
|
SecretKey(SecretKeySpec keySpec)
|
|
| Method Summary | |
void |
destroyCriticalData()
Destroys the critical data of this object. |
java.lang.String |
getAlgorithm()
Returns the name of the key algorithm for this key. |
byte[] |
getEncoded()
Returns a copy of the secret key as byte array. |
java.lang.String |
getFormat()
Returns the format name. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public SecretKey(byte[] key,
java.lang.String algName)
This constructor is called from inside a KeyGenerator to create a SecretKey.
Applications shall use the KeyGenerator.getInstance
and generateKey methods for creating a SecretKey object.
key - the key as byte arrayalgName - the name of the key algorithmKeyGenerator.getInstance(java.lang.String),
KeyGenerator.generateKey()public SecretKey(SecretKeySpec keySpec)
public SecretKey(byte[] key,
int off,
int len,
java.lang.String algName)
off, only len bytes of the given key
byte array are used for creating the SecretKey.
This constructor is called from inside a KeyGenerator to create a SecretKey.
Applications shall use the KeyGenerator.getInstance
and generateKey methods for creating a SecretKey object.
key - the key as byte arrayalgName - the name of the key algorithmKeyGenerator.getInstance(java.lang.String),
KeyGenerator.generateKey()| Method Detail |
public byte[] getEncoded()
public java.lang.String getAlgorithm()
public java.lang.String getFormat()
public void destroyCriticalData()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||