s4:heimdal: import lorikeet-heimdal-202201172009 (commit 5a0b45cd723628b3690ea848548b...
[samba.git] / source4 / heimdal / lib / asn1 / cms.asn1
1 -- From RFC 3369 --
2 -- $Id$ --
3
4 CMS DEFINITIONS ::= BEGIN
5
6 IMPORTS CertificateSerialNumber, AlgorithmIdentifier, Name,
7         Attribute, Certificate, SubjectKeyIdentifier FROM rfc2459
8         HEIM_ANY FROM heim;
9
10 id-pkcs7 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
11          us(840) rsadsi(113549) pkcs(1) pkcs7(7) }
12
13 id-pkcs7-data OBJECT IDENTIFIER ::=                     { id-pkcs7 1 }
14 id-pkcs7-signedData OBJECT IDENTIFIER ::=               { id-pkcs7 2 }
15 id-pkcs7-envelopedData OBJECT IDENTIFIER ::=            { id-pkcs7 3 }
16 id-pkcs7-signedAndEnvelopedData OBJECT IDENTIFIER ::=   { id-pkcs7 4 }
17 id-pkcs7-digestedData OBJECT IDENTIFIER ::=             { id-pkcs7 5 }
18 id-pkcs7-encryptedData OBJECT IDENTIFIER ::=            { id-pkcs7 6 }
19
20 CMSVersion ::= INTEGER {
21            cMSVersion-v0(0),
22            cMSVersion-v1(1),
23            cMSVersion-v2(2),
24            cMSVersion-v3(3),
25            cMSVersion-v4(4)
26 }
27
28 DigestAlgorithmIdentifier ::= AlgorithmIdentifier
29 DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier
30 SignatureAlgorithmIdentifier ::= AlgorithmIdentifier
31
32 ContentType ::= OBJECT IDENTIFIER
33 MessageDigest ::= OCTET STRING
34
35 ContentInfo ::= SEQUENCE {
36         contentType ContentType,
37         content [0] EXPLICIT HEIM_ANY OPTIONAL --  DEFINED BY contentType
38 }
39
40 EncapsulatedContentInfo ::= SEQUENCE {
41         eContentType ContentType,
42         eContent [0] EXPLICIT OCTET STRING OPTIONAL
43 }
44
45 CertificateSet ::= SET OF HEIM_ANY
46
47 CertificateList ::= Certificate
48
49 CertificateRevocationLists ::= SET OF CertificateList
50
51 IssuerAndSerialNumber ::= SEQUENCE {
52         issuer Name,
53         serialNumber CertificateSerialNumber
54 }
55
56 -- RecipientIdentifier is same as SignerIdentifier,
57 -- lets glue them togheter and save some bytes and share code for them
58
59 CMSIdentifier ::= CHOICE {
60         issuerAndSerialNumber IssuerAndSerialNumber,
61         subjectKeyIdentifier [0] SubjectKeyIdentifier
62 }
63
64 SignerIdentifier ::= CMSIdentifier
65 RecipientIdentifier ::= CMSIdentifier
66
67 --- CMSAttributes are the combined UnsignedAttributes and SignedAttributes
68 --- to store space and share code
69
70 CMSAttributes ::= SET OF Attribute              -- SIZE (1..MAX)
71
72 SignatureValue ::= OCTET STRING
73
74 SignerInfo ::= SEQUENCE {
75         version CMSVersion,
76         sid SignerIdentifier,
77         digestAlgorithm DigestAlgorithmIdentifier,
78         signedAttrs [0] IMPLICIT CMSAttributes OPTIONAL,
79         signatureAlgorithm SignatureAlgorithmIdentifier,
80         signature SignatureValue,
81         unsignedAttrs [1] IMPLICIT CMSAttributes OPTIONAL
82 }
83
84 SignerInfos ::= SET OF SignerInfo
85
86 SignedData ::= SEQUENCE {
87         version CMSVersion,
88         digestAlgorithms DigestAlgorithmIdentifiers,
89         encapContentInfo EncapsulatedContentInfo,
90         certificates [0] IMPLICIT CertificateSet OPTIONAL,
91         crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
92         signerInfos SignerInfos
93 }
94
95 OriginatorInfo ::= SEQUENCE {
96         certs [0] IMPLICIT CertificateSet OPTIONAL,
97         crls [1] IMPLICIT CertificateRevocationLists OPTIONAL
98 }
99
100 KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
101 ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
102
103 EncryptedKey ::= OCTET STRING
104
105 KeyTransRecipientInfo ::= SEQUENCE {
106         version CMSVersion,  -- always set to 0 or 2
107         rid RecipientIdentifier,
108         keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
109         encryptedKey EncryptedKey
110 }
111
112 RecipientInfo ::= KeyTransRecipientInfo
113
114 RecipientInfos ::= SET OF RecipientInfo
115
116 EncryptedContent ::= OCTET STRING
117
118 EncryptedContentInfo ::= SEQUENCE {
119         contentType ContentType,
120         contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
121         encryptedContent [0] IMPLICIT OCTET STRING OPTIONAL
122 }
123
124 UnprotectedAttributes ::= SET OF Attribute      -- SIZE (1..MAX)
125
126 CMSEncryptedData ::= SEQUENCE {
127         version CMSVersion,
128         encryptedContentInfo EncryptedContentInfo,
129         unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL
130 }
131
132 EnvelopedData ::= SEQUENCE {
133         version CMSVersion,
134         originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
135         recipientInfos RecipientInfos,
136         encryptedContentInfo EncryptedContentInfo,
137         unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL
138 }
139
140 -- Data ::= OCTET STRING
141
142 CMSRC2CBCParameter ::= SEQUENCE {
143         rc2ParameterVersion     INTEGER (0..4294967295),
144         iv                      OCTET STRING -- exactly 8 octets
145 }
146
147 CMSCBCParameter ::= OCTET STRING
148
149 END