Module java.base
Package javax.crypto

Class SecretKeyFactory

java.lang.Object
javax.crypto.SecretKeyFactory

public class SecretKeyFactory extends Object
This class represents a factory for secret keys.

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 operate only on secret (symmetric) keys.

Key factories are bidirectional, 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.

Application developers should refer to their provider's documentation to find out which key specifications are supported by the generateSecret and getKeySpec methods. For example, the DESede (Triple DES) secret-key factory supplied by the "SunJCE" provider supports DESedeKeySpec as a transparent representation of Triple DES keys.

Every implementation of the Java platform is required to support the following standard SecretKeyFactory algorithms:

  • DESede
These algorithms are described in the SecretKeyFactory section of the Java Security Standard Algorithm Names Specification. Consult the release documentation for your implementation to see if any other algorithms are supported.

Since:
1.4
See Also: