HKDF.derive
ubyte[] derive(const(ubyte)[] secret, const(ubyte)[] salt, size_t length)Derives a key of the specified length using the standard KDF interface.
This method performs both Extract and Expand steps. The 'salt' parameter is used as the salt for Extract. The 'info' parameter for Expand is assumed to be empty (null).
Parameters
secret | The input keying material (IKM). |
salt | The salt (optional, but recommended). |
length | The desired length of the output keying material (OKM). |
Returns
The derived key bytes.
ubyte[] derive(const(ubyte)[] secret, const(ubyte)[] salt, size_t length, KDFParams params)Derives a key using the given parameters.
Uses params.info as the context information for the Expand step. If params.info is null, the behavior is identical to the basic derive overload.
Parameters
secret | The input keying material (IKM). |
salt | The salt (optional, but recommended). |
length | The desired length of the output keying material (OKM). |
params | Algorithm-specific parameters. Only info is used. |
Returns
The derived key bytes.
ubyte[] derive(const(ubyte)[] secret, const(ubyte)[] salt, const(ubyte)[] info, size_t length)Derives a key with context information.
Parameters
secret | The input keying material (IKM). |
salt | The salt (optional). |
info | Context and application specific information (optional). |
length | The desired length of the output keying material (OKM). |
Returns
The derived key bytes.