Top Fields Constructors Methods
org.bouncycastle.jcajce.provider

pack-priv final Class ProvSecretKeySpec

extends SecretKeySpec
implements Destroyable, ProvKey<SymmetricKey>
Class Inheritance
All Implemented Interfaces
org.bouncycastle.jcajce.provider.ProvKey, javax.security.auth.Destroyable
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, java.util.concurrent.atomic.AtomicBoolean, javax.crypto.spec.SecretKeySpec, javax.security.auth.Destroyable, org.bouncycastle.crypto.Algorithm, .SymmetricKey, .SymmetricSecretKey, org.bouncycastle.crypto.internal.ValidatedSymmetricKey, org.bouncycastle.util.Arrays

Field Summary

Modifier and TypeField and Description
private transient ValidatedSymmetricKey
private final AtomicBoolean
private static final long

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
destroy()

Overrides default javax.security.auth.Destroyable.destroy.

Destroy this Object.
public String
getAlgorithm()

Overrides javax.crypto.spec.SecretKeySpec.getAlgorithm.

Implements java.security.Key.getAlgorithm.

Returns the name of the algorithm associated with this secret key.
public SymmetricKey
public byte[]
getEncoded()

Overrides javax.crypto.spec.SecretKeySpec.getEncoded.

Implements java.security.Key.getEncoded.

Returns the key material of this secret key.
public String
getFormat()

Overrides javax.crypto.spec.SecretKeySpec.getFormat.

Implements java.security.Key.getFormat.

Returns the name of the encoding format for this secret key.
public boolean
isDestroyed()

Overrides default javax.security.auth.Destroyable.isDestroyed.

Determine if this Object has been destroyed.
private void
readObject(ObjectInputStream
the ObjectInputStream from which data is read
in
)

Hides javax.crypto.spec.SecretKeySpec.readObject.

Restores the state of this object from the stream.
private void
Inherited from javax.crypto.spec.SecretKeySpec:
equalshashCode

Field Detail

baseKeyback to summary
private transient ValidatedSymmetricKey baseKey
hasBeenDestroyedback to summary
private final AtomicBoolean hasBeenDestroyed
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.crypto.spec.SecretKeySpec.serialVersionUID, javax.crypto.SecretKey.serialVersionUID.

Constructor Detail

ProvSecretKeySpecback to summary
public ProvSecretKeySpec(ValidatedSymmetricKey key)
ProvSecretKeySpecback to summary
public ProvSecretKeySpec(ValidatedSymmetricKey key, String standardName)

Method Detail

destroyback to summary
public void destroy()

Overrides default javax.security.auth.Destroyable.destroy.

Doc from javax.security.auth.Destroyable.destroy.

Destroy this Object.

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.

getAlgorithmback to summary
public String getAlgorithm()

Overrides javax.crypto.spec.SecretKeySpec.getAlgorithm.

Implements java.security.Key.getAlgorithm.

Doc from javax.crypto.spec.SecretKeySpec.getAlgorithm.

Returns the name of the algorithm associated with this secret key.

Returns:String

the secret key algorithm.

getBaseKeyback to summary
public SymmetricKey getBaseKey()

Implements org.bouncycastle.jcajce.provider.ProvKey.getBaseKey.

getEncodedback to summary
public byte[] getEncoded()

Overrides javax.crypto.spec.SecretKeySpec.getEncoded.

Implements java.security.Key.getEncoded.

Doc from javax.crypto.spec.SecretKeySpec.getEncoded.

Returns the key material of this secret key.

Returns:byte[]

the key material. Returns a new array each time this method is called.

getFormatback to summary
public String getFormat()

Overrides javax.crypto.spec.SecretKeySpec.getFormat.

Implements java.security.Key.getFormat.

Doc from javax.crypto.spec.SecretKeySpec.getFormat.

Returns the name of the encoding format for this secret key.

Returns:String

the string "RAW".

isDestroyedback to summary
public boolean isDestroyed()

Overrides default javax.security.auth.Destroyable.isDestroyed.

Doc from javax.security.auth.Destroyable.isDestroyed.

Determine if this Object has been destroyed.

Returns:boolean

true if this Object has been destroyed, false otherwise.

readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException

Hides javax.crypto.spec.SecretKeySpec.readObject.

Doc from javax.crypto.spec.SecretKeySpec.readObject.

Restores the state of this object from the stream.

Parameters
in:ObjectInputStream

the ObjectInputStream from which data is read

Exceptions
IOException:
if an I/O error occurs
ClassNotFoundException:
if a serialized class cannot be loaded
writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException