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.
StructsΒ§
EnumsΒ§
- Cose
Extract πError - Safe
Object πNamespace
ConstantsΒ§
- ALG_
ARGO πN2ID13 - 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 - 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 π - 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.
- XCHACH
A20_ πTEXT_ PAD_ BLOCK_ SIZE
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
- decrypt_
cose π - Decrypt a CoseEncrypt0 message with a CoseKey
- decrypt_
xchacha20_ πpoly1305 - Decrypts a COSE Encrypt0 message, using a XChaCha20Poly1305 key
- encrypt_
cose π - Encrypt a plaintext message with a given key
- encrypt_
xchacha20_ πpoly1305 - Encrypts a plaintext message using XChaCha20Poly1305 and returns a COSE Encrypt0 message
- extract_
bytes π - extract_
integer π - should_
pad_ πcontent