Module kdf
kdf module perform EVP_KDF operations.
It base on EVP_KDF in OpenSSL v3.
Usage:
hamc = require('openssl').kdf
Info:
- Author: george zhao <zhaozg(at)gmail.com>
Functions
iterator (cb) | traverses all openssl.kdf, and calls fn with each openssl.kdf |
fetch (name) | fetch openssl.kdf object by name |
deilver (kdf, array) | compute KDF delive, openssl version >= v3 |
deilver (pass, salt, digest[, iterator=1000[, keylen=32]]) | compute KDF delive, openssl version < v3 |
Class kdf_ctx
kdf_ctx:dup () | duplicate kdf_ctx object |
kdf_ctx:reset () | reset kdf_ctx object |
kdf_ctx:derive (paramaters) | derive the key |
kdf_ctx:size () | get size of openssl.kdf_ctx |
kdf_ctx:kdf () | get openssl.kdf of openssl.kdf_ctx |
kdf_ctx:gettable_params () | get array with parameters that describes the retrievable parameters. |
kdf_ctx:settable_params () | get array with parameters that describes the settable parameters. |
kdf_ctx:get_params (parameters) | retrieves parameters |
kdf_ctx:set_params (parameters) | set parameters |
Class openssl.kdf
openssl.kdf:deilver (array) | compute KDF delive |
openssl.kdf:fetch () | create new openssl.kdf_ctx object |
openssl.kdf:description () | get description |
openssl.kdf:name () | get description |
openssl.kdf:provider () | get provider |
openssl.kdf:is_a (name) | check kdf is an implementation of an algorithm that’s identifiable with name |
openssl.kdf:iterator (cb) | traverses all names for kdf, and calls fn with each name |
openssl.kdf:gettable_params () | get array that describes the retrievable parameters. |
openssl.kdf:gettable_ctx_params () | get array with parameters that can be retrieved from an openssl.kdf_ctx. |
openssl.kdf:settable_ctx_params () | get array with parameters that can be set to an openssl.kdf_ctx. |
openssl.kdf:get_params () | retrieves details about the implementation kdf. |
Functions
- iterator (cb)
-
traverses all openssl.kdf, and calls fn with each openssl.kdf
Parameters:
- cb function (openssl.kdf)
Returns:
-
none
- fetch (name)
-
fetch openssl.kdf object by name
Parameters:
- name string
Returns:
- deilver (kdf, array)
-
compute KDF delive, openssl version >= v3
Parameters:
Returns:
-
string
result binary string
- deilver (pass, salt, digest[, iterator=1000[, keylen=32]])
-
compute KDF delive, openssl version < v3
Parameters:
- pass string
- salt string
- digest string, object or nid
- iterator number (default 1000)
- keylen number (default 32)
Returns:
-
string
deilved result binary string
Class kdf_ctx
openssl.kdf_ctx object
- kdf_ctx:dup ()
-
duplicate kdf_ctx object
Returns:
-
openssl.kdf_ctx or fail
- kdf_ctx:reset ()
-
reset kdf_ctx object
Returns:
- kdf_ctx:derive (paramaters)
-
derive the key
Parameters:
- paramaters
table
, settable paramaters can be get by
kdf:settable_ctx_params()
Returns:
-
string or fail
- paramaters
table
, settable paramaters can be get by
- kdf_ctx:size ()
-
get size of openssl.kdf_ctx
Returns:
-
number
- kdf_ctx:kdf ()
-
get openssl.kdf of openssl.kdf_ctx
Returns:
- kdf_ctx:gettable_params ()
-
get array with parameters that describes the retrievable parameters.
Returns:
- kdf_ctx:settable_params ()
-
get array with parameters that describes the settable parameters.
Returns:
- kdf_ctx:get_params (parameters)
-
retrieves parameters
Parameters:
- parameters table to retrieves
Returns:
- kdf_ctx:set_params (parameters)
-
set parameters
Parameters:
- parameters table
Returns:
-
boolean
Class openssl.kdf
openssl.kdf object
- openssl.kdf:deilver (array)
-
compute KDF delive
Parameters:
- array table of paramaters
Returns:
-
string
result binary string
- openssl.kdf:fetch ()
-
create new openssl.kdf_ctx object
Returns:
-
openssl.kdf_ctx or fail
- openssl.kdf:description ()
-
get description
Returns:
- openssl.kdf:name ()
-
get description
Returns:
-
string or nil
- openssl.kdf:provider ()
-
get provider
Returns:
-
lightuserdata
- openssl.kdf:is_a (name)
-
check kdf is an implementation of an algorithm that’s identifiable with name
Parameters:
- name string an algorithm that’s identifiable with name
Returns:
-
boolean
- openssl.kdf:iterator (cb)
-
traverses all names for kdf, and calls fn with each name
Parameters:
- cb function (name)
Returns:
-
boolean
- openssl.kdf:gettable_params ()
-
get array that describes the retrievable parameters.
Returns:
- openssl.kdf:gettable_ctx_params ()
-
get array with parameters that can be retrieved from an openssl.kdf_ctx.
Returns:
- openssl.kdf:settable_ctx_params ()
-
get array with parameters that can be set to an openssl.kdf_ctx.
Returns:
- openssl.kdf:get_params ()
-
retrieves details about the implementation kdf.
Returns: