KDF) class.
All the abstract methods in this class must be implemented by each cryptographic service provider who wishes to supply the implementation of a particular key derivation function algorithm.
Implementations must provide a public constructor which accepts a KDFParameters object if they depend on the default implementation of
Provider.Service.newInstance to construct KDFSpi instances.
The constructor must call super(params) passing the parameters
supplied. The constructor must also throw an
InvalidAlgorithmParameterException if the supplied parameters are
inappropriate. If a KDF object is instantiated with one of the
getInstance methods that contains a KDFParameters parameter,
the user-provided KDFParameters object will be passed to the
constructor of the KDFSpi implementation. Otherwise, if it is
instantiated with one of the getInstance methods without a
KDFParameters parameter, a null value will be passed to the
constructor.
Implementations which do not support KDFParameters must require
null to be passed, otherwise an
InvalidAlgorithmParameterException will be thrown. On the other hand,
implementations which require KDFParameters should throw an
InvalidAlgorithmParameterException upon receiving a null
value if default parameters cannot be generated or upon receiving KDFParameters which are not supported by the implementation.
To aid the caller, implementations may return parameters with additional
default values or supply random values as used by the underlying KDF
algorithm. See KDFSpi#engineGetParameters() for more details.
KDF, KDFParameters, KDF#getParameters(), SecretKey
| Access | Constructor and Description |
|---|---|
| protected | KDFSpi(KDFParameters
the initialization parameters for the kdfParameters)KDF algorithm (may
be null)The sole constructor. |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract byte[] | Returns: the derived key in its raw bytes.derivation parameters derivationSpec)Derives a key, returns raw data as a byte array. |
| protected abstract SecretKey | Returns: the derived key.the algorithm of the resultant alg, AlgorithmParameterSpec SecretKey object.
See the SecretKey Algorithms section in the
Java Security Standard Algorithm Names Specification
for information about standard secret key algorithm names.derivation parameters derivationSpec)Derives a key, returned as a |
| protected abstract KDFParameters | Returns: the parameters used with thisKDF object, or
nullReturns the |
| KDFSpi | back to summary |
|---|---|
| protected KDFSpi(KDFParameters kdfParameters) throws InvalidAlgorithmParameterException The sole constructor.
A
| |
| engineDeriveData | back to summary |
|---|---|
| protected abstract byte[] engineDeriveData(AlgorithmParameterSpec derivationSpec) throws InvalidAlgorithmParameterException Derives a key, returns raw data as a byte array.
| |
| engineDeriveKey | back to summary |
|---|---|
| protected abstract SecretKey engineDeriveKey(String alg, AlgorithmParameterSpec derivationSpec) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException Derives a key, returned as a Implementation Note If the resultant key is extractable, then its
| |
| engineGetParameters | back to summary |
|---|---|
| protected abstract KDFParameters engineGetParameters() Returns the
The returned parameters may be the same that were used to initialize
this
| |