• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2021 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 ////////////////////////////////////////////////////////////////////////////////
16 
17 //! Enumerations for IANA-managed values.
18 //!
19 //! Sources:
20 //! - <https://www.iana.org/assignments/cose/cose.xhtml>
21 //! - <https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml>
22 //! - <https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats>
23 
24 #[cfg(test)]
25 mod tests;
26 
27 /// Trait indicating an enum that can be constructed from `i64` values.
28 pub trait EnumI64: Sized + Eq {
from_i64(i: i64) -> Option<Self>29     fn from_i64(i: i64) -> Option<Self>;
to_i64(&self) -> i6430     fn to_i64(&self) -> i64;
31 }
32 
33 /// Trait indicating an enum with a range of private values.
34 pub trait WithPrivateRange {
is_private(i: i64) -> bool35     fn is_private(i: i64) -> bool;
36 }
37 
38 /// Generate an enum with associated values, plus a `from_i64` method.
39 macro_rules! iana_registry {
40     ( $(#[$attr:meta])* $enum_name:ident {$($(#[$fattr:meta])* $name:ident: $val:expr,)* } ) => {
41         #[allow(non_camel_case_types)]
42         $(#[$attr])*
43         #[non_exhaustive]
44         #[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
45         pub enum $enum_name {
46             $($(#[$fattr])* $name = $val,)*
47         }
48         impl EnumI64 for $enum_name {
49             fn from_i64(i: i64) -> Option<Self> {
50                 match i {
51                     $(x if x == Self::$name as i64 => Some(Self::$name),)*
52                     _ => None,
53                 }
54             }
55             #[inline]
56             fn to_i64(&self) -> i64 {
57                 *self as i64
58             }
59         }
60     }
61 }
62 
63 iana_registry! {
64     /// IANA-registered COSE header parameters.
65     ///
66     /// From IANA registry <https://www.iana.org/assignments/cose/cose.xhtml#header-parameters>
67     /// as of 2021-03-19.
68     HeaderParameter {
69         /// Reserved
70         Reserved: 0,
71         /// Cryptographic algorithm to use
72         ///
73         /// Associated value of type int / tstr
74         Alg: 1,
75         /// Critical headers to be understood
76         ///
77         /// Associated value of type [+ label]
78         Crit: 2,
79         /// Content type of the payload
80         ///
81         /// Associated value of type tstr / uint
82         ContentType: 3,
83         /// Key identifier
84         ///
85         /// Associated value of type bstr
86         Kid: 4,
87         /// Full Initialization Vector
88         ///
89         /// Associated value of type bstr
90         Iv: 5,
91         /// Partial Initialization Vector
92         ///
93         /// Associated value of type bstr
94         PartialIv: 6,
95         /// CBOR-encoded signature structure
96         ///
97         /// Associated value of type COSE_Signature / [+ COSE_Signature ]
98         CounterSignature: 7,
99         /// Counter signature with implied signer and headers
100         ///
101         /// Associated value of type bstr
102         CounterSignature0: 9,
103         /// Identifies the context for the key identifier
104         ///
105         /// Associated value of type bstr
106         KidContext: 10,
107         /// An unordered bag of X.509 certificates
108         ///
109         /// Associated value of type COSE_X509
110         X5Bag: 32,
111         /// An ordered chain of X.509 certificates
112         ///
113         /// Associated value of type COSE_X509
114         X5Chain: 33,
115         /// Hash of an X.509 certificate
116         ///
117         /// Associated value of type COSE_CertHash
118         X5T: 34,
119         /// URI pointing to an X.509 certificate
120         ///
121         /// Associated value of type uri
122         X5U: 35,
123         /// Challenge Nonce
124         ///
125         /// Associated value of type bstr
126         CuphNonce: 256,
127         /// Public Key
128         ///
129         /// Associated value of type array
130         CuphOwnerPubKey: 257,
131     }
132 }
133 
134 /// Integer values for COSE header parameters below this value are reserved for private use.
135 pub const HEADER_PARAMETER_PRIVATE_USE_MAX: i64 = -65536;
136 
137 impl WithPrivateRange for HeaderParameter {
is_private(i: i64) -> bool138     fn is_private(i: i64) -> bool {
139         i < HEADER_PARAMETER_PRIVATE_USE_MAX
140     }
141 }
142 
143 iana_registry! {
144     /// IANA-registered COSE header algorithm parameters.
145     ///
146     /// From IANA registry <https://www.iana.org/assignments/cose/cose.xhtml#header-algorithm-parameters>
147     /// as of 2021-03-19.
148     HeaderAlgorithmParameter {
149         /// Party V other provided information
150         ///
151         /// Associated value of type bstr
152         PartyVOther: -26,
153         /// Party V provided nonce
154         ///
155         /// Associated value of type bstr / int
156         PartyVNonce: -25,
157         /// Party V identity information
158         ///
159         /// Associated value of type bstr
160         PartyVIdentity: -24,
161         /// Party U other provided information
162         ///
163         /// Associated value of type bstr
164         PartyUOther: -23,
165         /// Party U provided nonce
166         ///
167         /// Associated value of type bstr / int
168         PartyUNonce: -22,
169         /// Party U identity information
170         ///
171         /// Associated value of type bstr
172         PartyUIdentity: -21,
173         /// Random salt
174         ///
175         /// Associated value of type bstr
176         Salt: -20,
177         /// Static public key identifier for the sender
178         ///
179         /// Associated value of type bstr
180         StaticKeyId: -3,
181         /// Static public key for the sender
182         ///
183         /// Associated value of type COSE_Key
184         StaticKey: -2,
185         /// Ephemeral public key for the sender
186         ///
187         /// Associated value of type COSE_Key
188         EphemeralKey: -1,
189     }
190 }
191 
192 iana_registry! {
193     /// IANA-registered COSE algorithms.
194     ///
195     /// From IANA registry <https://www.iana.org/assignments/cose/cose.xhtml#algorithms>
196     /// as of 2021-03-19.
197     Algorithm {
198         /// RSASSA-PKCS1-v1_5 using SHA-1
199         RS1: -65535,
200         /// WalnutDSA signature
201         WalnutDSA: -260,
202         /// RSASSA-PKCS1-v1_5 using SHA-512
203         RS512: -259,
204         /// RSASSA-PKCS1-v1_5 using SHA-384
205         RS384: -258,
206         /// RSASSA-PKCS1-v1_5 using SHA-256
207         RS256: -257,
208         /// ECDSA using secp256k1 curve and SHA-256
209         ES256K: -47,
210         /// HSS/LMS hash-based digital signature
211         HSS_LMS: -46,
212         /// SHAKE-256 512-bit Hash Value
213         SHAKE256: -45,
214         /// SHA-2 512-bit Hash
215         SHA_512: -44,
216         /// SHA-2 384-bit Hash
217         SHA_384: -43,
218         /// RSAES-OAEP w/ SHA-512
219         RSAES_OAEP_SHA_512: -42,
220         /// RSAES-OAEP w/ SHA-256
221         RSAES_OAEP_SHA_256: -41,
222         /// RSAES-OAEP w/ SHA-1
223         RSAES_OAEP_RFC_8017_default: -40,
224         /// RSASSA-PSS w/ SHA-512
225         PS512: -39,
226         /// RSASSA-PSS_SHA-384
227         PS384: -38,
228         /// RSASSA-PSS w/ SHA-256
229         PS256: -37,
230         /// ECDSA w/ SHA-512
231         ES512: -36,
232         /// ECDSA w/ SHA-384
233         ES384: -35,
234         /// ECDH SS w/ Concat KDF and AES Key Wrap w/ 256-bit key
235         ECDH_SS_A256KW: -34,
236         /// ECDH SS w/ Concat KDF and AES Key Wrap w/ 192-bit key
237         ECDH_SS_A192KW: -33,
238         /// ECDH SS w/ Concat KDF and AES Key Wrap w/ 128-bit key
239         ECDH_SS_A128KW: -32,
240         /// ECDH ES w/ Concat KDF and AES Key Wrap w/ 256-bit key
241         ECDH_ES_A256KW: -31,
242         /// ECDH ES w/ Concat KDF and AES Key Wrap w/ 192-bit key
243         ECDH_ES_A192KW: -30,
244         /// ECDH ES w/ Concat KDF and AES Key Wrap w/ 128-bit key
245         ECDH_ES_A128KW: -29,
246         /// ECDH SS w/ HKDF - generate key directly
247         ECDH_SS_HKDF_512: -28,
248         /// ECDH SS w/ HKDF - generate key directly
249         ECDH_SS_HKDF_256: -27,
250         /// ECDH ES w/ HKDF - generate key directly
251         ECDH_ES_HKDF_512: -26,
252         /// ECDH ES w/ HKDF - generate key directly
253         ECDH_ES_HKDF_256: -25,
254         /// SHAKE-128 256-bit Hash Value
255         SHAKE128: -18,
256         /// SHA-2 512-bit Hash truncated to 256-bits
257         SHA_512_256: -17,
258         /// SHA-2 256-bit Hash
259         SHA_256: -16,
260         /// SHA-2 256-bit Hash truncated to 64-bits
261         SHA_256_64: -15,
262         /// SHA-1 Hash
263         SHA_1: -14,
264         /// Shared secret w/ AES-MAC 256-bit key
265         Direct_HKDF_AES_256: -13,
266         /// Shared secret w/ AES-MAC 128-bit key
267         Direct_HKDF_AES_128: -12,
268         /// Shared secret w/ HKDF and SHA-512
269         Direct_HKDF_SHA_512: -11,
270         /// Shared secret w/ HKDF and SHA-256
271         Direct_HKDF_SHA_256: -10,
272         /// EdDSA
273         EdDSA: -8,
274         /// ECDSA w/ SHA-256
275         ES256: -7,
276         /// Direct use of CEK
277         Direct: -6,
278         /// AES Key Wrap w/ 256-bit key
279         A256KW: -5,
280         /// AES Key Wrap w/ 192-bit key
281         A192KW: -4,
282         /// AES Key Wrap w/ 128-bit key
283         A128KW: -3,
284         /// Reserved
285         Reserved: 0,
286         /// AES-GCM mode w/ 128-bit key, 128-bit tag
287         A128GCM: 1,
288         /// AES-GCM mode w/ 192-bit key, 128-bit tag
289         A192GCM: 2,
290         /// AES-GCM mode w/ 256-bit key, 128-bit tag
291         A256GCM: 3,
292         /// HMAC w/ SHA-256 truncated to 64 bits
293         HMAC_256_64: 4,
294         /// HMAC w/ SHA-256
295         HMAC_256_256: 5,
296         /// HMAC w/ SHA-384
297         HMAC_384_384: 6,
298         /// HMAC w/ SHA-512
299         HMAC_512_512: 7,
300         /// AES-CCM mode 128-bit key, 64-bit tag, 13-byte nonce
301         AES_CCM_16_64_128: 10,
302         /// AES-CCM mode 256-bit key, 64-bit tag, 13-byte nonce
303         AES_CCM_16_64_256: 11,
304         /// AES-CCM mode 128-bit key, 64-bit tag, 7-byte nonce
305         AES_CCM_64_64_128: 12,
306         /// AES-CCM mode 256-bit key, 64-bit tag, 7-byte nonce
307         AES_CCM_64_64_256: 13,
308         /// AES-MAC 128-bit key, 64-bit tag
309         AES_MAC_128_64: 14,
310         /// AES-MAC 256-bit key, 64-bit tag
311         AES_MAC_256_64: 15,
312         /// ChaCha20/Poly1305 w/ 256-bit key, 128-bit tag
313         ChaCha20Poly1305: 24,
314         /// AES-MAC 128-bit key, 128-bit tag
315         AES_MAC_128_128: 25,
316         /// AES-MAC 256-bit key, 128-bit tag
317         AES_MAC_256_128: 26,
318         /// AES-CCM mode 128-bit key, 128-bit tag, 13-byte nonce
319         AES_CCM_16_128_128: 30,
320         /// AES-CCM mode 256-bit key, 128-bit tag, 13-byte nonce
321         AES_CCM_16_128_256: 31,
322         /// AES-CCM mode 128-bit key, 128-bit tag, 7-byte nonce
323         AES_CCM_64_128_128: 32,
324         /// AES-CCM mode 256-bit key, 128-bit tag, 7-byte nonce
325         AES_CCM_64_128_256: 33,
326         /// For doing IV generation for symmetric algorithms.
327         IV_GENERATION: 34,
328     }
329 }
330 
331 /// Integer values for COSE algorithms below this value are reserved for private use.
332 pub const ALGORITHM_PRIVATE_USE_MAX: i64 = -65536;
333 
334 impl WithPrivateRange for Algorithm {
is_private(i: i64) -> bool335     fn is_private(i: i64) -> bool {
336         i < ALGORITHM_PRIVATE_USE_MAX
337     }
338 }
339 
340 iana_registry! {
341     /// IANA-registered COSE common key parameters.
342     ///
343     /// From IANA registry <https://www.iana.org/assignments/cose/cose.xhtml#key-common-parameters>
344     /// as of 2021-03-19.
345     KeyParameter {
346         /// Reserved value.
347         Reserved: 0,
348         /// Identification of the key type
349         ///
350         /// Associated value of type tstr / int
351         Kty: 1,
352         /// Key identification value - match to kid in message
353         ///
354         /// Associated value of type bstr
355         Kid: 2,
356         /// Key usage restriction to this algorithm
357         ///
358         /// Associated value of type tstr / int
359         Alg: 3,
360         /// Restrict set of permissible operations
361         ///
362         /// Associated value of type [+ (tstr / int)]
363         KeyOps: 4,
364         /// Base IV to be XORed with Partial IVs
365         ///
366         /// Associated value of type bstr
367         BaseIv: 5,
368     }
369 }
370 
371 iana_registry! {
372     /// IANA-registered COSE key parameters for keys of type [`KeyType::OKP`].
373     ///
374     /// From IANA registry <https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters>
375     /// as of 2021-03-19.
376     OkpKeyParameter {
377         /// EC identifier - Taken from the "COSE Elliptic Curves" registry
378         ///
379         /// Associated value of type tstr / int
380         Crv: -1,
381         /// x-coordinate
382         ///
383         /// Associated value of type bstr
384         X: -2,
385         /// Private key
386         ///
387         /// Associated value of type bstr
388         D: -4,
389     }
390 }
391 
392 iana_registry! {
393     /// IANA-registered COSE key parameters for keys of type [`KeyType::EC2`].
394     ///
395     /// From IANA registry <https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters>
396     /// as of 2021-03-19.
397     Ec2KeyParameter {
398         /// EC identifier - Taken from the "COSE Elliptic Curves" registry
399         ///
400         /// Associated value of type tstr / int
401         Crv: -1,
402         /// Public Key
403         ///
404         /// Associated value of type bstr
405         X: -2,
406         /// y-coordinate
407         ///
408         /// Associated value of type bstr / bool
409         Y: -3,
410         /// Private key
411         ///
412         /// Associated value of type bstr
413         D: -4,
414     }
415 }
416 
417 iana_registry! {
418     /// IANA-registered COSE key parameters for keys of type [`KeyType::RSA`].
419     ///
420     /// From IANA registry <https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters>
421     /// as of 2021-03-19.
422     RsaKeyParameter {
423         /// The RSA modulus n
424         ///
425         /// Associated value of type bstr
426         N: -1,
427         /// The RSA public exponent e
428         ///
429         /// Associated value of type bstr
430         E: -2,
431         /// The RSA private exponent d
432         ///
433         /// Associated value of type bstr
434         D: -3,
435         /// The prime factor p of n
436         ///
437         /// Associated value of type bstr
438         P: -4,
439         /// The prime factor q of n
440         ///
441         /// Associated value of type bstr
442         Q: -5,
443         /// dP is d mod (p - 1)
444         ///
445         /// Associated value of type bstr
446         DP: -6,
447         /// dQ is d mod (q - 1)
448         ///
449         /// Associated value of type bstr
450         DQ: -7,
451         /// qInv is the CRT coefficient q^(-1) mod p
452         ///
453         /// Associated value of type bstr
454         QInv: -8,
455         /// Other prime infos, an array
456         ///
457         /// Associated value of type array
458         Other: -9,
459         /// a prime factor r_i of n, where i >= 3
460         ///
461         /// Associated value of type bstr
462         RI: -10,
463         /// d_i = d mod (r_i - 1)
464         ///
465         /// Associated value of type bstr
466         DI: -11,
467         /// The CRT coefficient t_i = (r_1 * r_2 * ... * r_(i-1))^(-1) mod r_i
468         ///
469         /// Associated value of type bstr
470         TI: -12,
471     }
472 }
473 
474 iana_registry! {
475     /// IANA-registered COSE key parameters for keys of type [`KeyType::Symmetric`].
476     ///
477     /// From IANA registry <https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters>
478     /// as of 2021-03-19.
479     SymmetricKeyParameter {
480         /// Key Value
481         ///
482         /// Associated value of type bstr
483         K: -1,
484     }
485 }
486 
487 iana_registry! {
488     /// IANA-registered COSE key parameters for keys of type [`KeyType::HSS_LMS`].
489     ///
490     /// From IANA registry <https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters>
491     /// as of 2021-03-19.
492     HssLmsKeyParameter {
493         /// Public key for HSS/LMS hash-based digital signature
494         ///
495         /// Associated value of type bstr
496         Pub: -1,
497     }
498 }
499 
500 iana_registry! {
501     /// IANA-registered COSE key parameters for keys of type [`KeyType::WalnutDSA`].
502     ///
503     /// From IANA registry <https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters>
504     /// as of 2021-03-19.
505     WalnutDsaKeyParameter {
506         /// Group and Matrix (NxN) size
507         ///
508         /// Associated value of type uint
509         N: -1,
510         /// Finite field F_q
511         ///
512         /// Associated value of type uint
513         Q: -2,
514         /// List of T-values, enties in F_q
515         ///
516         /// Associated value of type array of uint
517         TValues: -3,
518         /// NxN Matrix of enties in F_q in column-major form
519         ///
520         /// Associated value of type array of array of uint
521         Matrix1: -4,
522         /// Permutation associated with matrix 1
523         ///
524         /// Associated value of type array of uint
525         Permutation1: -5,
526         /// NxN Matrix of enties in F_q in column-major form
527         ///
528         /// Associated value of type array of array of uint
529         Matrix2: -6,
530     }
531 }
532 
533 iana_registry! {
534     /// IANA-registered COSE key types.
535     ///
536     /// From IANA registry <https://www.iana.org/assignments/cose/cose.xhtml#key-type>
537     /// as of 2021-03-19.
538     KeyType {
539         /// This value is reserved
540         Reserved: 0,
541         /// Octet Key Pair
542         OKP: 1,
543         /// Elliptic Curve Keys w/ x- and y-coordinate pair
544         EC2: 2,
545         /// RSA Key
546         RSA: 3,
547         /// Symmetric Keys
548         Symmetric: 4,
549         /// Public key for HSS/LMS hash-based digital signature
550         HSS_LMS: 5,
551         /// WalnutDSA public key
552         WalnutDSA: 6,
553     }
554 }
555 
556 iana_registry! {
557     /// IANA-registered COSE elliptic curves.
558     ///
559     /// From IANA registry <https://www.iana.org/assignments/cose/cose.xhtml#elliptic-curves>
560     /// as of 2021-03-19.
561     EllipticCurve {
562         Reserved: 0,
563         /// EC2: NIST P-256 also known as secp256r1
564         P_256: 1,
565         /// EC2: NIST P-384 also known as secp384r1
566         P_384: 2,
567         /// EC2: NIST P-521 also known as secp521r1
568         P_521: 3,
569         /// OKP: X25519 for use w/ ECDH only
570         X25519: 4,
571         /// OKP: X448 for use w/ ECDH only
572         X448: 5,
573         /// OKP: Ed25519 for use w/ EdDSA only
574         Ed25519: 6,
575         /// OKP: Ed448 for use w/ EdDSA only
576         Ed448: 7,
577         /// EC2: SECG secp256k1 curve
578         Secp256k1: 8,
579     }
580 }
581 
582 /// Integer values for COSE elliptic curves below this value are reserved for private use.
583 pub const ELLIPTIC_CURVE_PRIVATE_USE_MAX: i64 = -65536;
584 
585 impl WithPrivateRange for EllipticCurve {
is_private(i: i64) -> bool586     fn is_private(i: i64) -> bool {
587         i < ELLIPTIC_CURVE_PRIVATE_USE_MAX
588     }
589 }
590 
591 iana_registry! {
592     /// Key operation values.
593     ///
594     /// See RFC 8152 section 7.1 table 4.
595     KeyOperation {
596         /// Key is used to create signatures. Requires private key fields.
597         Sign: 1,
598         /// Key is used for verification of signatures.
599         Verify: 2,
600         /// Key is used for key transport encryption.
601         Encrypt: 3,
602         /// Key is used for key transport decryption. Requires private key fields.
603         Decrypt: 4,
604         /// Key is used for key wrap encryption.
605         WrapKey: 5,
606         /// Key is used for key wrap decryption.  Requires private key fields.
607         UnwrapKey: 6,
608         /// Key is used for deriving keys.  Requires private key fields.
609         DeriveKey: 7,
610         /// Key is used for deriving bits not to be used as a key.  Requires private key fields.
611         DeriveBits: 8,
612         /// Key is used for creating MACs.
613         MacCreate: 9,
614         /// Key is used for validating MACs.
615         MacVerify: 10,
616     }
617 }
618 
619 iana_registry! {
620     /// CBOR tag values for COSE structures.
621     ///
622     /// From IANA registry <https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml>
623     /// as of 2021-03-19.
624     CborTag {
625         /// COSE Single Recipient Encrypted Data Object
626         CoseEncrypt0: 16,
627         /// COSE Mac w/o Recipients Object
628         CoseMac0: 17,
629         /// COSE Single Signer Data Object
630         CoseSign1: 18,
631         /// CBOR Web Token (CWT)
632         Cwt: 61,
633         /// COSE Encrypted Data Object
634         CoseEncrypt: 96,
635         /// COSE MACed Data Object
636         CoseMac: 97,
637         /// COSE Signed Data Object
638         CoseSign: 98,
639     }
640 }
641 
642 iana_registry! {
643     /// CoAP Content Formats
644     ///
645     /// From IANA registry <https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats>
646     /// as of 2021-03-19.
647     CoapContentFormat {
648         /// text/plain; charset=utf-8
649         TextPlainUtf8: 0,
650         /// application/cose; cose-type="cose-encrypt0"
651         CoseEncrypt0: 16,
652         /// application/cose; cose-type="cose-mac0"
653         CoseMac0: 17,
654         /// application/cose; cose-type="cose-sign1"
655         CoseSign1: 18,
656         /// application/link-format
657         LinkFormat: 40,
658         /// application/xml
659         Xml: 41,
660         /// application/octet-stream
661         OctetStream: 42,
662         /// application/exi
663         Exi: 47,
664         /// application/json
665         Json: 50,
666         /// application/json-patch+json
667         JsonPatchJson: 51,
668         /// application/merge-patch+json
669         MergePatchJson: 52,
670         /// application/cbor
671         Cbor: 60,
672         /// application/cwt
673         Cwt: 61,
674         /// application/multipart-core
675         MultipartCore: 62,
676         /// application/cbor-seq
677         CborSeq: 63,
678         /// application/cose; cose-type="cose-encrypt"
679         CoseEncrypt: 96,
680         /// application/cose; cose-type="cose-mac"
681         CoseMac: 97,
682         /// application/cose; cose-type="cose-sign"
683         CoseSign: 98,
684         /// application/cose-key
685         CoseKey: 101,
686         /// application/cose-key-set
687         CoseKeySet: 102,
688         /// application/senml+json
689         SenmlJson: 110,
690         /// application/sensml+json
691         SensmlJson: 111,
692         /// application/senml+cbor
693         SenmlCbor: 112,
694         /// application/sensml+cbor
695         SensmlCbor: 113,
696         /// application/senml-exi
697         SenmlExi: 114,
698         /// application/sensml-exi
699         SensmlExi: 115,
700         /// application/coap-group+json
701         CoapGroupJson: 256,
702         /// application/dots+cbor
703         DotsCbor: 271,
704         /// application/pkcs7-mime; smime-type=server-generated-key
705         Pkcs7MimeSmimeTypeServerGeneratedKey: 280,
706         /// application/pkcs7-mime; smime-type=certs-only
707         Pkcs7MimeSmimeTypeCertsOnly: 281,
708         /// application/pkcs7-mime; smime-type=CMC-Request
709         Pkcs7MimeSmimeTypeCmcRequest: 282,
710         /// application/pkcs7-mime; smime-type=CMC-Response
711         Pkcs7MimeSmimeTypeCmcResponse: 283,
712         /// application/pkcs8
713         Pkcs8: 284,
714         /// application/csrattrs
715         Csrattrs: 285,
716         /// application/pkcs10
717         Pkcs10: 286,
718         /// application/pkix-cert
719         PkixCert: 287,
720         /// application/senml+xml
721         SenmlXml: 310,
722         /// application/sensml+xml
723         SensmlXml: 311,
724         /// application/senml-etch+json
725         SenmlEtchJson: 320,
726         /// application/senml-etch+cbor
727         SenmlEtchCbor: 322,
728         /// application/td+json
729         TdJson: 432,
730         /// application/vnd.ocf+cbor
731         VndOcfCbor: 10000,
732         /// application/oscore
733         Oscore: 10001,
734         // application/json deflate
735         JsonDeflate: 11050,
736         // application/cbor deflate
737         CborDeflate: 11060,
738         /// application/vnd.oma.lwm2m+tlv
739         VndOmaLwm2mTlv: 11542,
740         /// application/vnd.oma.lwm2m+json
741         VndOmaLwm2mJson: 11543,
742         /// application/vnd.oma.lwm2m+cbor
743         VndOmaLwm2mCbor: 11544,
744     }
745 }
746