4 DEFINITIONS IMPLICIT TAGS ::=
8 -- This contains both PKIX1Implicit88 and RFC2630 ASN.1 modules.
10 id-pkix OBJECT IDENTIFIER ::=
11 { iso(1) identified-organization(3) dod(6) internet(1)
12 security(5) mechanisms(5) pkix(7) }
14 -- ISO arc for standard certificate and CRL extensions
16 -- authority key identifier OID and syntax
18 AuthorityKeyIdentifier ::= SEQUENCE {
19 keyIdentifier [0] KeyIdentifier OPTIONAL,
20 authorityCertIssuer [1] GeneralNames OPTIONAL,
21 authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL }
22 -- authorityCertIssuer and authorityCertSerialNumber shall both
23 -- be present or both be absgent
25 KeyIdentifier ::= OCTET STRING
27 -- subject key identifier OID and syntax
29 SubjectKeyIdentifier ::= KeyIdentifier
31 -- key usage extension OID and syntax
33 KeyUsage ::= BIT STRING
35 -- Directory string type --
37 DirectoryString ::= CHOICE {
38 teletexString TeletexString (SIZE (1..MAX)),
39 printableString PrintableString (SIZE (1..MAX)),
40 universalString UniversalString (SIZE (1..MAX)),
41 utf8String UTF8String (SIZE (1..MAX)),
42 bmpString BMPString (SIZE(1..MAX)),
43 -- IA5String is added here to handle old UID encoded as ia5String --
44 -- See tests/userid/ for more information. It shouldn't be here, --
45 -- so if it causes problems, considering dropping it. --
46 ia5String IA5String (SIZE(1..MAX)) }
48 SubjectAltName ::= GeneralNames
50 GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
52 GeneralName ::= CHOICE {
53 otherName [0] AnotherName,
54 rfc822Name [1] IA5String,
55 dNSName [2] IA5String,
57 -- Changed to work with the libtasn1 parser.
58 directoryName [4] EXPLICIT RDNSequence, --Name,
59 ediPartyName [5] ANY, --EDIPartyName replaced by ANY to save memory
60 uniformResourceIdentifier [6] IA5String,
61 iPAddress [7] OCTET STRING,
62 registeredID [8] OBJECT IDENTIFIER }
64 -- AnotherName replaces OTHER-NAME ::= TYPE-IDENTIFIER, as
65 -- TYPE-IDENTIFIER is not supported in the '88 ASN.1 syntax
67 AnotherName ::= SEQUENCE {
68 type-id OBJECT IDENTIFIER,
69 value [0] EXPLICIT ANY DEFINED BY type-id }
71 -- issuer alternative name extension OID and syntax
73 IssuerAltName ::= GeneralNames
75 -- basic constraints extension OID and syntax
77 BasicConstraints ::= SEQUENCE {
78 cA BOOLEAN DEFAULT FALSE,
79 pathLenConstraint INTEGER (0..MAX) OPTIONAL }
81 -- CRL distribution points extension OID and syntax
83 CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
85 DistributionPoint ::= SEQUENCE {
86 distributionPoint [0] EXPLICIT DistributionPointName OPTIONAL,
87 reasons [1] ReasonFlags OPTIONAL,
88 cRLIssuer [2] GeneralNames OPTIONAL
91 DistributionPointName ::= CHOICE {
92 fullName [0] GeneralNames,
93 nameRelativeToCRLIssuer [1] RelativeDistinguishedName
96 ReasonFlags ::= BIT STRING
98 -- extended key usage extension OID and syntax
100 ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
102 KeyPurposeId ::= OBJECT IDENTIFIER
104 -- CRL number extension OID and syntax
106 CRLNumber ::= INTEGER (0..MAX)
108 -- certificate issuer CRL entry extension OID and syntax
110 CertificateIssuer ::= GeneralNames
112 -- --------------------------------------
114 -- --------------------------------------
116 -- UNIVERSAL Types defined in '93 and '98 ASN.1
117 -- but required by this specification
119 NumericString ::= [UNIVERSAL 18] IMPLICIT OCTET STRING
121 IA5String ::= [UNIVERSAL 22] IMPLICIT OCTET STRING
123 TeletexString ::= [UNIVERSAL 20] IMPLICIT OCTET STRING
125 PrintableString ::= [UNIVERSAL 19] IMPLICIT OCTET STRING
127 UniversalString ::= [UNIVERSAL 28] IMPLICIT OCTET STRING
128 -- UniversalString is defined in ASN.1:1993
130 BMPString ::= [UNIVERSAL 30] IMPLICIT OCTET STRING
131 -- BMPString is the subtype of UniversalString and models
132 -- the Basic Multilingual Plane of ISO/IEC/ITU 10646-1
134 UTF8String ::= [UNIVERSAL 12] IMPLICIT OCTET STRING
135 -- The content of this type conforms to RFC 2279.
138 -- attribute data types --
140 Attribute ::= SEQUENCE {
142 values SET OF AttributeValue
143 -- at least one value is required --
146 AttributeType ::= OBJECT IDENTIFIER
148 AttributeValue ::= ANY DEFINED BY type
150 AttributeTypeAndValue ::= SEQUENCE {
152 value AttributeValue }
154 -- suggested naming attributes: Definition of the following
155 -- information object set may be augmented to meet local
156 -- requirements. Note that deleting members of the set may
157 -- prevent interoperability with conforming implementations.
158 -- presented in pairs: the AttributeType followed by the
159 -- type definition for the corresponding AttributeValue
161 -- Arc for standard naming attributes
162 id-at OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 4}
164 -- Attributes of type NameDirectoryString
166 -- gnutls: Note that the Object ID (id-at*) is being set just before the
167 -- actual definition. This is done in order for asn1_find_structure_from_oid
168 -- to work (locate structure from OID).
169 -- Maybe this is inefficient and memory consuming. Should we replace with
170 -- a table that maps OIDs to structures?
172 PostalAddress ::= SEQUENCE OF DirectoryString
176 emailAddress AttributeType ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 1 }
178 Pkcs9email ::= IA5String (SIZE (1..ub-emailaddress-length))
180 -- naming data types --
182 Name ::= CHOICE { -- only one possibility for now --
183 rdnSequence RDNSequence }
185 RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
187 DistinguishedName ::= RDNSequence
189 RelativeDistinguishedName ::=
190 SET SIZE (1 .. MAX) OF AttributeTypeAndValue
194 -- --------------------------------------------------------
195 -- certificate and CRL specific structures begin here
196 -- --------------------------------------------------------
198 Certificate ::= SEQUENCE {
199 tbsCertificate TBSCertificate,
200 signatureAlgorithm AlgorithmIdentifier,
201 signature BIT STRING }
203 TBSCertificate ::= SEQUENCE {
204 version [0] EXPLICIT Version DEFAULT v1,
205 serialNumber CertificateSerialNumber,
206 signature AlgorithmIdentifier,
210 subjectPublicKeyInfo SubjectPublicKeyInfo,
211 issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
212 -- If present, version shall be v2 or v3
213 subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
214 -- If present, version shall be v2 or v3
215 extensions [3] EXPLICIT Extensions OPTIONAL
216 -- If present, version shall be v3 --
219 Version ::= INTEGER { v1(0), v2(1), v3(2) }
221 CertificateSerialNumber ::= INTEGER
223 Validity ::= SEQUENCE {
229 generalTime GeneralizedTime }
231 UniqueIdentifier ::= BIT STRING
233 SubjectPublicKeyInfo ::= SEQUENCE {
234 algorithm AlgorithmIdentifier,
235 subjectPublicKey BIT STRING }
237 Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
239 Extension ::= SEQUENCE {
240 extnID OBJECT IDENTIFIER,
241 critical BOOLEAN DEFAULT FALSE,
242 extnValue OCTET STRING }
245 -- ------------------------------------------
247 -- ------------------------------------------
249 CertificateList ::= SEQUENCE {
250 tbsCertList TBSCertList,
251 signatureAlgorithm AlgorithmIdentifier,
252 signature BIT STRING }
254 TBSCertList ::= SEQUENCE {
255 version Version OPTIONAL,
256 -- if present, shall be v2
257 signature AlgorithmIdentifier,
260 nextUpdate Time OPTIONAL,
261 revokedCertificates SEQUENCE OF SEQUENCE {
262 userCertificate CertificateSerialNumber,
264 crlEntryExtensions Extensions OPTIONAL
265 -- if present, shall be v2
267 crlExtensions [0] EXPLICIT Extensions OPTIONAL
268 -- if present, shall be v2 --
271 -- Version, Time, CertificateSerialNumber, and Extensions were
272 -- defined earlier for use in the certificate structure
274 AlgorithmIdentifier ::= SEQUENCE {
275 algorithm OBJECT IDENTIFIER,
276 parameters ANY DEFINED BY algorithm OPTIONAL }
277 -- contains a value of the type
278 -- registered for use with the
279 -- algorithm object identifier value
281 -- Algorithm OIDs and parameter structures
283 Dss-Sig-Value ::= SEQUENCE {
288 DomainParameters ::= SEQUENCE {
289 p INTEGER, -- odd prime, p=jq +1
290 g INTEGER, -- generator, g
291 q INTEGER, -- factor of p-1
292 j INTEGER OPTIONAL, -- subgroup factor, j>= 2
293 validationParms ValidationParms OPTIONAL }
295 ValidationParms ::= SEQUENCE {
297 pgenCounter INTEGER }
299 Dss-Parms ::= SEQUENCE {
304 -- x400 address syntax starts here
307 CountryName ::= [APPLICATION 1] CHOICE {
308 x121-dcc-code NumericString
309 (SIZE (ub-country-name-numeric-length)),
310 iso-3166-alpha2-code PrintableString
311 (SIZE (ub-country-name-alpha-length)) }
313 OrganizationName ::= PrintableString
314 (SIZE (1..ub-organization-name-length))
315 -- see also teletex-organization-name
317 NumericUserIdentifier ::= NumericString
318 (SIZE (1..ub-numeric-user-id-length))
320 -- see also teletex-personal-name
322 OrganizationalUnitNames ::= SEQUENCE SIZE (1..ub-organizational-units)
323 OF OrganizationalUnitName
324 -- see also teletex-organizational-unit-names
326 OrganizationalUnitName ::= PrintableString (SIZE
327 (1..ub-organizational-unit-name-length))
329 -- Extension types and attribute values
332 CommonName ::= PrintableString
334 -- END of PKIX1Implicit88
339 -- Cryptographic Message Syntax
341 pkcs-7-ContentInfo ::= SEQUENCE {
342 contentType pkcs-7-ContentType,
343 content [0] EXPLICIT ANY DEFINED BY contentType }
345 pkcs-7-DigestInfo ::= SEQUENCE {
346 digestAlgorithm pkcs-7-DigestAlgorithmIdentifier,
350 pkcs-7-Digest ::= OCTET STRING
352 pkcs-7-ContentType ::= OBJECT IDENTIFIER
354 pkcs-7-SignedData ::= SEQUENCE {
355 version pkcs-7-CMSVersion,
356 digestAlgorithms pkcs-7-DigestAlgorithmIdentifiers,
357 encapContentInfo pkcs-7-EncapsulatedContentInfo,
358 certificates [0] IMPLICIT pkcs-7-CertificateSet OPTIONAL,
359 crls [1] IMPLICIT pkcs-7-CertificateRevocationLists OPTIONAL,
360 signerInfos pkcs-7-SignerInfos
363 pkcs-7-CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4) }
365 pkcs-7-DigestAlgorithmIdentifiers ::= SET OF pkcs-7-DigestAlgorithmIdentifier
367 pkcs-7-DigestAlgorithmIdentifier ::= AlgorithmIdentifier
369 pkcs-7-EncapsulatedContentInfo ::= SEQUENCE {
370 eContentType pkcs-7-ContentType,
371 eContent [0] EXPLICIT OCTET STRING OPTIONAL }
373 -- We don't use CertificateList here since we only want
374 -- to read the raw data.
375 pkcs-7-CertificateRevocationLists ::= SET OF ANY
377 pkcs-7-CertificateChoices ::= CHOICE {
378 -- Although the paper uses Certificate type, we
379 -- don't use it since, we don't need to parse it.
380 -- We only need to read and store it.
384 pkcs-7-CertificateSet ::= SET OF pkcs-7-CertificateChoices
386 pkcs-7-SignerInfos ::= SET OF ANY -- this is not correct but we don't use it
392 -- Certificate requests
393 pkcs-10-CertificationRequestInfo ::= SEQUENCE {
394 version INTEGER { v1(0) },
396 subjectPKInfo SubjectPublicKeyInfo,
397 attributes [0] Attributes
400 Attributes ::= SET OF Attribute
402 pkcs-10-CertificationRequest ::= SEQUENCE {
403 certificationRequestInfo pkcs-10-CertificationRequestInfo,
404 signatureAlgorithm AlgorithmIdentifier,
410 pkcs-9-at-challengePassword OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 7}
412 pkcs-9-challengePassword ::= CHOICE {
413 printableString PrintableString,
414 utf8String UTF8String }
416 pkcs-9-localKeyId ::= OCTET STRING
420 -- Private-key information syntax
422 pkcs-8-PrivateKeyInfo ::= SEQUENCE {
423 version pkcs-8-Version,
424 privateKeyAlgorithm AlgorithmIdentifier,
425 privateKey pkcs-8-PrivateKey,
426 attributes [0] Attributes OPTIONAL }
428 pkcs-8-Version ::= INTEGER {v1(0)}
430 pkcs-8-PrivateKey ::= OCTET STRING
432 pkcs-8-Attributes ::= SET OF Attribute
434 -- Encrypted private-key information syntax
436 pkcs-8-EncryptedPrivateKeyInfo ::= SEQUENCE {
437 encryptionAlgorithm AlgorithmIdentifier,
438 encryptedData pkcs-8-EncryptedData
441 pkcs-8-EncryptedData ::= OCTET STRING
445 pkcs-5-des-EDE3-CBC-params ::= OCTET STRING (SIZE(8))
446 pkcs-5-aes128-CBC-params ::= OCTET STRING (SIZE(16))
447 pkcs-5-aes192-CBC-params ::= OCTET STRING (SIZE(16))
448 pkcs-5-aes256-CBC-params ::= OCTET STRING (SIZE(16))
450 pkcs-5-PBES2-params ::= SEQUENCE {
451 keyDerivationFunc AlgorithmIdentifier,
452 encryptionScheme AlgorithmIdentifier }
456 -- pkcs-5-algid-hmacWithSHA1 AlgorithmIdentifier ::=
457 -- {algorithm pkcs-5-id-hmacWithSHA1, parameters NULL : NULL}
459 pkcs-5-PBKDF2-params ::= SEQUENCE {
461 specified OCTET STRING,
462 otherSource AlgorithmIdentifier
464 iterationCount INTEGER (1..MAX),
465 keyLength INTEGER (1..MAX) OPTIONAL,
466 prf AlgorithmIdentifier OPTIONAL -- DEFAULT pkcs-5-id-hmacWithSHA1
471 pkcs-12-PFX ::= SEQUENCE {
472 version INTEGER {v3(3)},
473 authSafe pkcs-7-ContentInfo,
474 macData pkcs-12-MacData OPTIONAL
477 pkcs-12-PbeParams ::= SEQUENCE {
482 pkcs-12-MacData ::= SEQUENCE {
483 mac pkcs-7-DigestInfo,
484 macSalt OCTET STRING,
485 iterations INTEGER DEFAULT 1
486 -- Note: The default is for historical reasons and its use is
487 -- deprecated. A higher value, like 1024 is recommended.
490 pkcs-12-AuthenticatedSafe ::= SEQUENCE OF pkcs-7-ContentInfo
491 -- Data if unencrypted
492 -- EncryptedData if password-encrypted
493 -- EnvelopedData if public key-encrypted
495 pkcs-12-SafeContents ::= SEQUENCE OF pkcs-12-SafeBag
497 pkcs-12-SafeBag ::= SEQUENCE {
498 bagId OBJECT IDENTIFIER,
499 bagValue [0] EXPLICIT ANY DEFINED BY badId,
500 bagAttributes SET OF pkcs-12-PKCS12Attribute OPTIONAL
505 pkcs-12-KeyBag ::= pkcs-8-PrivateKeyInfo
509 pkcs-12-PKCS8ShroudedKeyBag ::= pkcs-8-EncryptedPrivateKeyInfo
513 pkcs-12-CertBag ::= SEQUENCE {
514 certId OBJECT IDENTIFIER,
515 certValue [0] EXPLICIT ANY DEFINED BY certId
518 -- x509Certificate BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-certTypes 1}}
519 -- DER-encoded X.509 certificate stored in OCTET STRING
521 pkcs-12-CRLBag ::= SEQUENCE {
522 crlId OBJECT IDENTIFIER,
523 crlValue [0] EXPLICIT ANY DEFINED BY crlId
526 pkcs-12-SecretBag ::= SEQUENCE {
527 secretTypeId OBJECT IDENTIFIER,
528 secretValue [0] EXPLICIT ANY DEFINED BY secretTypeId
531 -- x509CRL BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-crlTypes 1}}
532 -- DER-encoded X.509 CRL stored in OCTET STRING
534 pkcs-12-PKCS12Attribute ::= Attribute
536 -- PKCS #7 stuff (needed in PKCS 12)
538 pkcs-7-Data ::= OCTET STRING
540 pkcs-7-EncryptedData ::= SEQUENCE {
541 version pkcs-7-CMSVersion,
542 encryptedContentInfo pkcs-7-EncryptedContentInfo,
543 unprotectedAttrs [1] IMPLICIT pkcs-7-UnprotectedAttributes OPTIONAL }
545 pkcs-7-EncryptedContentInfo ::= SEQUENCE {
546 contentType pkcs-7-ContentType,
547 contentEncryptionAlgorithm pkcs-7-ContentEncryptionAlgorithmIdentifier,
548 encryptedContent [0] IMPLICIT pkcs-7-EncryptedContent OPTIONAL }
550 pkcs-7-ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
552 pkcs-7-EncryptedContent ::= OCTET STRING
554 pkcs-7-UnprotectedAttributes ::= SET SIZE (1..MAX) OF Attribute
558 ProxyCertInfo ::= SEQUENCE {
559 pCPathLenConstraint INTEGER (0..MAX) OPTIONAL,
560 proxyPolicy ProxyPolicy }
562 ProxyPolicy ::= SEQUENCE {
563 policyLanguage OBJECT IDENTIFIER,
564 policy OCTET STRING OPTIONAL }