Module symmetric_crypto_key

Source

Structs§

Aes256CbcHmacKey
Aes256CbcHmacKey is a symmetric encryption key consisting of two 256-bit keys, one for encryption and one for MAC
Aes256CbcKey
Aes256CbcKey is a symmetric encryption key, consisting of one 256-bit key, used to decrypt legacy type 0 enc strings. The data is not authenticated so this should be used with caution, and removed where possible.
XChaCha20Poly1305Key
XChaCha20Poly1305Key is a symmetric encryption key consisting of one 256-bit key, and contains a key id. In contrast to the Aes256CbcKey and Aes256CbcHmacKey, this key type is used to create CoseEncrypt0 messages.

Enums§

SymmetricCryptoKey
A symmetric encryption key. Used to encrypt and decrypt EncString

Functions§

pad_key 🔒
Pad a key to a minimum length using PKCS7-like padding. The last N bytes of the padded bytes all have the value N. For example, padded to size 4, the value 0,0 becomes 0,0,2,2.
unpad_key 🔒
Unpad a key that is padded using the PKCS7-like padding defined by pad_key. The last N bytes of the padded bytes all have the value N. For example, padded to size 4, the value 0,0 becomes 0,0,2,2.