Module java.base

Class SecretKeySpec

java.lang.Object
javax.crypto.spec.SecretKeySpec
All Implemented Interfaces:
Serializable, Key, KeySpec, SecretKey, Destroyable

public class SecretKeySpec extends Object implements KeySpec, SecretKey
This class specifies a secret key in a provider-independent fashion.

It can be used to construct a SecretKey from a byte array, without having to go through a (provider-based) SecretKeyFactory.

This class is only useful for raw secret keys that can be represented as a byte array and have no key parameters associated with them, e.g., DES or Triple DES keys.

Since:
1.4
See Also: