SecretKeyFactory
SecretKeyFactory is a component of the Java Cryptography Architecture (JCA) that converts a KeySpec into a SecretKey suitable for use with symmetric encryption algorithms. It is obtained with SecretKeyFactory.getInstance(algorithm) and is supplied by security providers such as SunJCE. The factory does not generate raw keys directly; instead it derives or builds a SecretKey from a specification that describes the source material and the derivation parameters.
The usual workflow is: select an algorithm supported by a provider, acquire a SecretKeyFactory for that algorithm,
Key specifications include PBEKeySpec for password-based keys, and legacy specs such as DESKeySpec or DESedeKeySpec for
SecretKeyFactory is part of the provider-based architecture of JCA/JCE, meaning implementations vary by provider and platform
See also: KeySpec, PBEKeySpec, SecretKey, PBKDF2, and Java Cryptography Architecture.