Skip to main content

Module symmetric_crypto_key

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.
Aes256GcmKey
Aes256GcmKey is a symmetric AEAD key consisting of one 256-bit key
XAes256GcmKey
An XAES-256-GCM key consisting of one 256-bit key and a key ID.
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ยง

CoseKeyView ๐Ÿ”’
A borrowed view over a symmetric key that is encoded as a COSE key.
EncodedSymmetricKey
Encoded representation of SymmetricCryptoKey
SymmetricCryptoKey
A symmetric encryption key. Used to encrypt and decrypt EncString
SymmetricKeyAlgorithm
The symmetric key algorithm to use when generating a new symmetric key.

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.