Skip to content

Latest commit

 

History

History
61 lines (52 loc) · 1.64 KB

File metadata and controls

61 lines (52 loc) · 1.64 KB

COSE

The COSE header defines enumerations and constants related to COSE messages. These definitions standardize the identification and handling of different COSE message components, ensuring consistent message formatting, parsing, and cryptographic operations across the system.

Enumerations:

  • COSETag
    Defines the various COSE message types by their corresponding tag values.

    typedef enum COSETag {
      Sign = 98,
      Sign1 = 18,
      Encrypted = 96,
      Encrypted1 = 16,
      Mac = 97,
      Mac0 = 17
    } COSETag;
  • COSEHeaderLabel
    Defines standard header labels used within COSE messages.

    typedef enum COSEHeaderLabel {
      Algorithm = 1,
      Critical = 2,
      ContentType = 3,
      KeyIdentifier = 4,
      IV = 5,
      PartialIV = 6,
      CounterSignature = 7,
      CounterSignature0 = 9,
      // ...
    } COSEHeaderLabel;
    • Algorithm = 1: Specifies the cryptographic algorithm.
    • Critical = 2: Indicates critical headers that must be understood by recipients.
    • ContentType = 3: Defines the content type of the payload.
    • KeyIdentifier = 4: Identifies the key used for signing or encryption.
    • IV = 5: Initialization Vector for encryption.
    • PartialIV = 6: Partial Initialization Vector.
    • CounterSignature = 7: Counter signature.
    • CounterSignature0 = 9: Alternate counter signature.
  • COSEAlgorithm
    Defines supported cryptographic algorithms for COSE message signing and encryption.

    typedef enum COSEAlgorithm {
      PS256 = -37,
      PS384 = -38,
      PS512 = -39,
      ES256 = -7,
      ES384 = -35,
      ES512 = -36,
      EdDSA = -8,
      // ...
    } COSEAlgorithm;