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]);