Uniot Core
0.8.1
Loading...
Searching...
No Matches
COSE.h
Go to the documentation of this file.
1/*
2 * This is a part of the Uniot project.
3 * Copyright (C) 2016-2023 Uniot <contact@uniot.io>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#pragma once
20
35
36namespace uniot {
37
46typedef enum COSETag {
47 Sign = 98,
48 Sign1 = 18,
49 Encrypted = 96,
51 Mac = 97,
52 Mac0 = 17
54
63typedef enum COSEHeaderLabel {
68 IV = 5,
72 // ... ///< Additional header parameters may be defined
74
84typedef enum COSEAlgorithm {
85 PS256 = -37,
86 PS384 = -38,
87 PS512 = -39,
88 ES256 = -7,
89 ES384 = -35,
90 ES512 = -36,
91 EdDSA = -8,
92 // ... ///< Additional algorithms may be defined
94
95} // namespace uniot
COSETag
CBOR tag values that identify the type of COSE message.
Definition COSE.h:46
COSEAlgorithm
Cryptographic algorithm identifiers for COSE.
Definition COSE.h:84
COSEHeaderLabel
Common header parameter labels for COSE messages.
Definition COSE.h:63
Contains all classes and functions related to the Uniot Core.
@ Mac0
Single recipient MAC (tag 17) - COSE_Mac0.
Definition COSE.h:52
@ Encrypted1
Single recipient encrypted data (tag 16) - COSE_Encrypt0.
Definition COSE.h:50
@ Encrypted
Multiple recipient encrypted data (tag 96) - COSE_Encrypt.
Definition COSE.h:49
@ Mac
Multiple recipient MAC (tag 97) - COSE_Mac.
Definition COSE.h:51
@ Sign
Multiple signature (tag 98) - COSE_Sign.
Definition COSE.h:47
@ Sign1
Single signature (tag 18) - COSE_Sign1.
Definition COSE.h:48
@ ES384
ECDSA w/ SHA-384.
Definition COSE.h:89
@ EdDSA
EdDSA signature algorithm.
Definition COSE.h:91
@ ES512
ECDSA w/ SHA-512.
Definition COSE.h:90
@ PS384
RSASSA-PSS w/ SHA-384.
Definition COSE.h:86
@ ES256
ECDSA w/ SHA-256.
Definition COSE.h:88
@ PS512
RSASSA-PSS w/ SHA-512.
Definition COSE.h:87
@ PS256
RSASSA-PSS w/ SHA-256.
Definition COSE.h:85
@ Algorithm
Cryptographic algorithm used (label 1)
Definition COSE.h:64
@ IV
Initialization Vector (label 5)
Definition COSE.h:68
@ CounterSignature0
Counter signature w/o countersigner (label 9)
Definition COSE.h:71
@ ContentType
Content type of the payload (label 3)
Definition COSE.h:66
@ Critical
Critical headers that must be understood (label 2)
Definition COSE.h:65
@ PartialIV
Partial Initialization Vector (label 6)
Definition COSE.h:69
@ CounterSignature
Counter signature (label 7)
Definition COSE.h:70
@ KeyIdentifier
Key identifier (kid) (label 4)
Definition COSE.h:67