|
CryptoSys PKI
23.0.0
|
Key derivation functions (KDF) More...
Public Types | |
| enum class | HashAlg |
| Hash algorithm for KDF. More... | |
| enum class | KdfAlg |
| KDF algorithm. More... | |
| enum class | KeyWrapAlg |
| Key wrap algorithm. More... | |
Static Public Member Functions | |
| static bvec_t | Bytes (int dklen, const bvec_t &ikm, KdfAlg kdfAlg=KdfAlg::X963, HashAlg hashAlg=HashAlg::Sha1, const bvec_t &sharedInfo={}, const std::string ¶mString="") |
| Generate a key-encryption key (KEK) from input keying material (IKM) using a key derivation function (KDF). More... | |
| static bvec_t | ForCms (const bvec_t &zz, KeyWrapAlg keyWrapAlg, KdfAlg kdfAlg=KdfAlg::X963, HashAlg hashAlg=HashAlg::Sha1, const bvec_t &ukm={}) |
| Generate a key-encryption key (KEK) for ECDH key exchange in a CMS EnvelopedData object. More... | |
Key derivation functions (KDF)
|
strong |
Hash algorithm for KDF.
| Enumerator | |
|---|---|
| Sha1 | SHA-1 (default) |
| Sha224 | SHA-224. |
| Sha256 | SHA-256. |
| Sha384 | SHA-384. |
| Sha512 | SHA-512. |
|
strong |
|
strong |
Key wrap algorithm.
| Enumerator | |
|---|---|
| Default | Default for Cms::MakeEnvData only. |
| Cms3DESwrap | Triple-DES Key Wrap algorithm from [RFC3217]. |
| Aes128_wrap | AES-128 key wrap from [RFC3394]. |
| Aes192_wrap | AES-192 key wrap from [RFC3394]. |
| Aes256_wrap | AES-256 key wrap from [RFC3394]. |
|
static |
Generate a key-encryption key (KEK) from input keying material (IKM) using a key derivation function (KDF).
| dklen | Required length of output key material in bytes. |
| ikm | Input key material/shared secret. |
| kdfAlg | Key derivation function to use. |
| hashAlg | Hash algorithm to use with the key derivation function. |
| sharedInfo | SharedInfo (optional) |
| paramString | Optional parameters. Set as "" for defaults. Use salt=<hex-digits> to set the optional salt parameter for the HKDF algorithm encoded in hex, e.g. "salt=606162636465666768696a6b6c6d6e6f;". |
|
static |
Generate a key-encryption key (KEK) for ECDH key exchange in a CMS EnvelopedData object.
| zz | Input key material/shared secret value (denoted variously as ZZ/Z/K/IKM). |
| keyWrapAlg | Key wrap algorithm (required, cannot be KeyWrapAlg::Default). |
| kdfAlg | Key derivation function to use. |
| hashAlg | Hash algorithm to use with the key derivation function. |
| ukm | Optional user key material (ukm). |