All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----javax.crypto.SecretKeyFactory
Key factories are used to convert keys (opaque
cryptographic keys of type Key) into key specifications
(transparent representations of the underlying key material), and vice
versa.
Secret key factories only operate on secret (symmetric) keys.
Key factories are bi-directional, i.e., they allow to build an opaque key object from a given key specification (key material), or to retrieve the underlying key material of a key object in a suitable format.
A provider should document the key specifications supported by its
secret key factory.
For example, the DES SecretKeyFactory of the Sun provider
supports DESKeySpec as a transparent representation of DES
keys, and the DES-EDE SecretKeyFactory supports
DESedeKeySpec as a transparent representation of DES-EDE keys.
SecretKey object from the provided key
specification (key material).
SecretKeyFactory object for the specified
secret key algorithm.
SecretKeyFactory object for the specified
secret key algorithm from the specified provider.
SecretKeyFactory object.
protected SecretKeyFactory(SecretKeyFactorySpi keyFacSpi,
Provider provider)
public static final SecretKeyFactory getInstance(String algorithm) throws NoSuchAlgorithmException
SecretKeyFactory object for the specified
secret key algorithm. If the
default provider package contains a SecretKeyFactory
subclass for the specified algorithm, an instance of that subclass
is returned. If such a key factory is not available in the default
provider package, other provider packages are searched.
SecretKeyFactory object for the specified
secret key algorithm.
public static final SecretKeyFactory getInstance(String algorithm,
String provider) throws NoSuchAlgorithmException, NoSuchProviderException
SecretKeyFactory object for the specified
secret key algorithm from the specified provider.
SecretKeyFactory object for the specified
secret key algorithm.
public final Provider getProvider()
SecretKeyFactory object.
SecretKeyFactory object
public final SecretKey generateSecret(KeySpec keySpec) throws InvalidKeySpecException
SecretKey object from the provided key
specification (key material).
public final KeySpec getKeySpec(SecretKey key,
Class keySpec) throws InvalidKeySpecException
public final SecretKey translateKey(SecretKey key) throws InvalidKeyException
All Packages Class Hierarchy This Package Previous Next Index