Skip to main content

structured_cms/
oid.rs

1//! CMS identifiers used by the protocol's schema and attribute rules.
2
3use structured_asn1::Oid;
4
5/// Arbitrary octets, `id-data` (RFC5652 §4).
6pub const DATA: Oid<'static> = Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 7, 1]);
7/// CMS `SignedData` (RFC5652 §5).
8pub const SIGNED_DATA: Oid<'static> =
9    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 7, 2]);
10/// Signed content-type attribute (RFC5652 §11.1).
11pub const CONTENT_TYPE: Oid<'static> =
12    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 3]);
13/// Signed message-digest attribute (RFC5652 §11.2).
14pub const MESSAGE_DIGEST: Oid<'static> =
15    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 4]);
16/// Signed signing-time attribute (RFC5652 §11.3).
17pub const SIGNING_TIME: Oid<'static> =
18    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 5]);
19/// Unsigned countersignature attribute (RFC5652 §11.4).
20pub const COUNTERSIGNATURE: Oid<'static> =
21    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 6]);
22/// Signed algorithm protection attribute (RFC6211 §2).
23pub const ALGORITHM_PROTECTION: Oid<'static> =
24    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 52]);
25
26/// ESS signing-certificate V1 (RFC5035 §5).
27pub const SIGNING_CERTIFICATE: Oid<'static> =
28    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 16, 2, 12]);
29/// ESS signing-certificate V2 (RFC5035 §3).
30pub const SIGNING_CERTIFICATE_V2: Oid<'static> =
31    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 16, 2, 47]);
32/// Exact ASN.1 SHA-256 default identity in `ESSCertIDv2` (RFC5035 §4).
33pub const SHA256: Oid<'static> = Oid::from_bytes(&[0x60, 0x86, 0x48, 1, 0x65, 3, 4, 2, 1]);
34/// SHA-1 identifies the ESS V1 compatibility requirement (RFC5035 §2),
35/// not a cryptographic backend or a policy permission to accept that hash.
36pub const SHA1: Oid<'static> = Oid::from_bytes(&[0x2b, 0x0e, 3, 2, 26]);
37/// Encapsulated timestamp information, `id-ct-TSTInfo` (RFC3161 §2.4.2).
38pub const TST_INFO: Oid<'static> =
39    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 16, 1, 4]);
40/// Whole OCSP response in CMS `OtherRevocationInfoFormat` (RFC5940 §3).
41pub const OCSP_RESPONSE: Oid<'static> = Oid::from_bytes(&[0x2b, 6, 1, 5, 5, 7, 16, 2]);
42/// Signed ESS content-hints (RFC2634 §2.9; EN 319 122-1 §5.2.4.1).
43pub const CONTENT_HINTS: Oid<'static> =
44    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 16, 2, 4]);
45/// Signed ESS content-identifier (RFC2634 §2.7; EN 319 122-1 §5.2.12).
46pub const CONTENT_IDENTIFIER: Oid<'static> =
47    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 16, 2, 7]);
48/// Signed ESS content-reference (RFC2634 §2.11; EN 319 122-1 §5.2.11).
49pub const CONTENT_REFERENCE: Oid<'static> =
50    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 16, 2, 10]);
51/// Unsigned `signature-time-stamp` (EN 319 122-1 §5.3).
52pub const SIGNATURE_TIMESTAMP: Oid<'static> =
53    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 16, 2, 14]);
54/// Signed `signature-policy-identifier` (EN 319 122-1 §5.2.9.1).
55pub const SIGNATURE_POLICY_IDENTIFIER: Oid<'static> =
56    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 16, 2, 15]);
57/// Signed `commitment-type-indication` (EN 319 122-1 §5.2.3).
58pub const COMMITMENT_TYPE_INDICATION: Oid<'static> =
59    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 16, 2, 16]);
60/// Signed `signer-location` (EN 319 122-1 §5.2.5).
61pub const SIGNER_LOCATION: Oid<'static> =
62    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 16, 2, 17]);
63/// Signed `content-time-stamp` (EN 319 122-1 §5.2.8).
64pub const CONTENT_TIMESTAMP: Oid<'static> =
65    Oid::from_bytes(&[0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 1, 9, 16, 2, 20]);
66/// Signed `mime-type`, `0.4.0.1733.2.1` (EN 319 122-1 §5.2.4.2).
67pub const MIME_TYPE: Oid<'static> = Oid::from_bytes(&[4, 0, 0x8d, 0x45, 2, 1]);
68/// Signed `signer-attributes-v2`, `0.4.0.19122.1.1` (EN 319 122-1 §5.2.6.1).
69pub const SIGNER_ATTRIBUTES_V2: Oid<'static> = Oid::from_bytes(&[4, 0, 0x81, 0x95, 0x32, 1, 1]);
70/// `claimed-SAML-assertion`, `0.4.0.19122.1.2`, carried only inside
71/// `signer-attributes-v2` (EN 319 122-1 §5.2.6.2).
72pub const CLAIMED_SAML_ASSERTION: Oid<'static> = Oid::from_bytes(&[4, 0, 0x81, 0x95, 0x32, 1, 2]);
73/// Unsigned `signature-policy-store`, `0.4.0.19122.1.3` (EN 319 122-1 §5.2.10).
74pub const SIGNATURE_POLICY_STORE: Oid<'static> = Oid::from_bytes(&[4, 0, 0x81, 0x95, 0x32, 1, 3]);
75/// Unsigned `ats-hash-index-v3`, `0.4.0.19122.1.5` (EN 319 122-1 §5.5.2).
76pub const ATS_HASH_INDEX_V3: Oid<'static> = Oid::from_bytes(&[4, 0, 0x81, 0x95, 0x32, 1, 5]);
77/// Unsigned `archive-time-stamp-v3`, `0.4.0.1733.2.4` (EN 319 122-1 §5.5.3).
78pub const ARCHIVE_TIMESTAMP_V3: Oid<'static> = Oid::from_bytes(&[4, 0, 0x8d, 0x45, 2, 4]);