public final class SymmetricSecretKey extends java.lang.Object implements SymmetricKey, javax.security.auth.Destroyable
Note: it the module is run under the SecurityManager only invokers with CryptoServicesPermission.FIPS_MODE_EXPORT_SECRET_KEY permission can successfully call the getKeyBytes() method.
Constructor and Description |
---|
SymmetricSecretKey(Algorithm algorithm,
byte[] bytes)
Base constructor.
|
SymmetricSecretKey(Parameters parameterSet,
byte[] bytes)
Base constructor for a specific algorithm associated with a parameter set.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
boolean |
equals(java.lang.Object o)
Return true if o is an equivalent key to this.
|
Algorithm |
getAlgorithm()
Return the algorithm this secret key is for.
|
byte[] |
getKeyBytes()
Return the bytes representing this keys value.
|
int |
hashCode()
Return the hashCode for the key.
|
boolean |
isDestroyed() |
public SymmetricSecretKey(Algorithm algorithm, byte[] bytes)
algorithm
- the algorithm this secret key is associated with.bytes
- the bytes representing the key's value.public SymmetricSecretKey(Parameters parameterSet, byte[] bytes)
parameterSet
- the parameter set with the algorithm this secret key is associated with.bytes
- the bytes representing the key's value.public Algorithm getAlgorithm()
getAlgorithm
in interface Key
public byte[] getKeyBytes()
See CryptoServicesPermission.FIPS_MODE_EXPORT_SECRET_KEY for the permission associated with this method.
getKeyBytes
in interface SymmetricKey
public boolean equals(java.lang.Object o)
Key
public int hashCode()
Key
public void destroy() throws javax.security.auth.DestroyFailedException
destroy
in interface javax.security.auth.Destroyable
javax.security.auth.DestroyFailedException
public boolean isDestroyed()
isDestroyed
in interface javax.security.auth.Destroyable