Expand description
This file contains private-use constants for COSE encoded key types and algorithms. Standardized values from https://www.iana.org/assignments/cose/cose.xhtml should always be preferred unless there is a a clear benefit, such as a clear cryptographic benefit, which MUST be documented publicly.
Re-exportsΒ§
pub use thumbprint::CoseKeyThumbprint;pub use thumbprint::CoseKeyThumbprintExt;
ModulesΒ§
- symmetric π
- COSE symmetric encryption β the middle layer of the three-layer stack:
- thumbprint π
- RFC 9679 COSE Key Thumbprints.
EnumsΒ§
- Cose
Extract πError - Safe
Object πNamespace
ConstantsΒ§
- ALG_
ARGO πN2ID13 - ALG_
PBKD πF2_ SHA256 - PBKDF2-HMAC-SHA256 KDF algorithm discriminant, used by the password protected key envelope in
the FIPS cipher suite. PBKDF2 is FIPS-approved, unlike Argon2id (
ALG_ARGON2ID13). - ARGO
N2_ πITERATIONS - ARGO
N2_ πMEMORY - ARGO
N2_ πPARALLELISM - ARGO
N2_ πSALT - CONTAINED_
KEY_ πID - Indicates for any object containing a key (wrapped key, password protected key envelope) which key ID that contained key has
- CONTENT_
TYPE_ πBITWARDEN_ LEGACY_ KEY - CONTENT_
TYPE_ πPADDED_ CBOR - CONTENT_
TYPE_ πPADDED_ UTF8 - CONTENT_
TYPE_ πSPKI_ PUBLIC_ KEY - PBKD
F2_ πITERATIONS - PBKDF2 iterations and salt, used by the password protected key envelope in the FIPS cipher suite.
- PBKD
F2_ πSALT - SAFE_
CONTENT_ πNAMESPACE - Each type of object has itβs own namespace for strong domain separation to eliminate attacks which attempt to confuse object types. For signatures, this refers to signature namespaces, for data envelopes to data envelope namespaces and so on.
- SAFE_
OBJECT_ πNAMESPACE - MUST be placed in the protected header of cose objects
- SIGNING_
NAMESPACE π - The label used for the namespace ensuring strong domain separation when using signatures.
- SYMMETRIC_
KEY π - XAES_
256_ πGCM - XAES-256-GCM (https://c2sp.org/XAES-256-GCM) extended-nonce AEAD. Given an input key and 192-bit nonce, a counter-based KDF is instantiated with CMAC-AES256, the input key, and the first 96 bits of the input nonce. The derived key and last 96 bits of the input nonce are then used to encrypt with AES-256-GCM.
- XCHACH
A20_ πPOLY1305 - XChaCha20 https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha-03 is used over ChaCha20 to be able to randomly generate nonces, and to not have to worry about key wearout. Since the draft was never published as an RFC, we use a private-use value for the algorithm.
TraitsΒ§
- Content
Namespace π - Cose
Serializable - Trait for structs that are serializable to COSE objects.
FunctionsΒ§
- debug_
key_ πoperation - Helper function to convert a COSE KeyOperation to a debug string
- extract_
bytes π - extract_
integer π