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 PrivateKeyUsagePeriod ::= SEQUENCE {
19 notBefore [0] GeneralizedTime OPTIONAL,
20 notAfter [1] GeneralizedTime OPTIONAL }
22 AuthorityKeyIdentifier ::= SEQUENCE {
23 keyIdentifier [0] KeyIdentifier OPTIONAL,
24 authorityCertIssuer [1] GeneralNames OPTIONAL,
25 authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL }
26 -- authorityCertIssuer and authorityCertSerialNumber shall both
27 -- be present or both be absgent
29 KeyIdentifier ::= OCTET STRING
31 -- subject key identifier OID and syntax
33 SubjectKeyIdentifier ::= KeyIdentifier
35 -- key usage extension OID and syntax
37 KeyUsage ::= BIT STRING
39 -- Directory string type --
41 DirectoryString ::= CHOICE {
42 teletexString TeletexString (SIZE (1..MAX)),
43 printableString PrintableString (SIZE (1..MAX)),
44 universalString UniversalString (SIZE (1..MAX)),
45 utf8String UTF8String (SIZE (1..MAX)),
46 bmpString BMPString (SIZE(1..MAX)),
47 -- IA5String is added here to handle old UID encoded as ia5String --
48 -- See tests/userid/ for more information. It shouldn't be here, --
49 -- so if it causes problems, considering dropping it. --
50 ia5String IA5String (SIZE(1..MAX)) }
52 SubjectAltName ::= GeneralNames
54 GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
56 GeneralName ::= CHOICE {
57 otherName [0] AnotherName,
58 rfc822Name [1] IA5String,
59 dNSName [2] IA5String,
61 -- Changed to work with the libtasn1 parser.
62 directoryName [4] EXPLICIT RDNSequence, --Name,
63 ediPartyName [5] ANY, --EDIPartyName replaced by ANY to save memory
64 uniformResourceIdentifier [6] IA5String,
65 iPAddress [7] OCTET STRING,
66 registeredID [8] OBJECT IDENTIFIER }
68 -- AnotherName replaces OTHER-NAME ::= TYPE-IDENTIFIER, as
69 -- TYPE-IDENTIFIER is not supported in the '88 ASN.1 syntax
71 AnotherName ::= SEQUENCE {
72 type-id OBJECT IDENTIFIER,
73 value [0] EXPLICIT ANY DEFINED BY type-id }
75 -- issuer alternative name extension OID and syntax
77 IssuerAltName ::= GeneralNames
79 -- basic constraints extension OID and syntax
81 BasicConstraints ::= SEQUENCE {
82 cA BOOLEAN DEFAULT FALSE,
83 pathLenConstraint INTEGER (0..MAX) OPTIONAL }
85 -- CRL distribution points extension OID and syntax
87 CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
89 DistributionPoint ::= SEQUENCE {
90 distributionPoint [0] EXPLICIT DistributionPointName OPTIONAL,
91 reasons [1] ReasonFlags OPTIONAL,
92 cRLIssuer [2] GeneralNames OPTIONAL
95 DistributionPointName ::= CHOICE {
96 fullName [0] GeneralNames,
97 nameRelativeToCRLIssuer [1] RelativeDistinguishedName
100 ReasonFlags ::= BIT STRING
102 -- extended key usage extension OID and syntax
104 ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
106 KeyPurposeId ::= OBJECT IDENTIFIER
108 -- authority info access
110 AuthorityInfoAccessSyntax ::=
111 SEQUENCE SIZE (1..MAX) OF AccessDescription
113 AccessDescription ::= SEQUENCE {
114 accessMethod OBJECT IDENTIFIER,
115 accessLocation GeneralName }
117 -- CRL number extension OID and syntax
119 -- CRLNumber ::= INTEGER (0..MAX)
121 -- certificate issuer CRL entry extension OID and syntax
123 -- CertificateIssuer ::= GeneralNames
125 -- --------------------------------------
127 -- --------------------------------------
129 -- UNIVERSAL Types defined in '93 and '98 ASN.1
130 -- but required by this specification
132 NumericString ::= [UNIVERSAL 18] IMPLICIT OCTET STRING
134 IA5String ::= [UNIVERSAL 22] IMPLICIT OCTET STRING
136 TeletexString ::= [UNIVERSAL 20] IMPLICIT OCTET STRING
138 PrintableString ::= [UNIVERSAL 19] IMPLICIT OCTET STRING
140 UniversalString ::= [UNIVERSAL 28] IMPLICIT OCTET STRING
141 -- UniversalString is defined in ASN.1:1993
143 BMPString ::= [UNIVERSAL 30] IMPLICIT OCTET STRING
144 -- BMPString is the subtype of UniversalString and models
145 -- the Basic Multilingual Plane of ISO/IEC/ITU 10646-1
147 UTF8String ::= [UNIVERSAL 12] IMPLICIT OCTET STRING
148 -- The content of this type conforms to RFC 2279.
151 -- attribute data types --
153 Attribute ::= SEQUENCE {
155 values SET OF AttributeValue
156 -- at least one value is required --
159 AttributeType ::= OBJECT IDENTIFIER
161 AttributeValue ::= ANY DEFINED BY type
163 AttributeTypeAndValue ::= SEQUENCE {
165 value AttributeValue }
167 -- suggested naming attributes: Definition of the following
168 -- information object set may be augmented to meet local
169 -- requirements. Note that deleting members of the set may
170 -- prevent interoperability with conforming implementations.
171 -- presented in pairs: the AttributeType followed by the
172 -- type definition for the corresponding AttributeValue
174 -- Arc for standard naming attributes
175 id-at OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 4}
177 -- Attributes of type NameDirectoryString
179 -- gnutls: Note that the Object ID (id-at*) is being set just before the
180 -- actual definition. This is done in order for asn1_find_structure_from_oid
181 -- to work (locate structure from OID).
182 -- Maybe this is inefficient and memory consuming. Should we replace with
183 -- a table that maps OIDs to structures?
185 -- PostalAddress ::= SEQUENCE OF DirectoryString
189 emailAddress AttributeType ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 1 }
191 -- Pkcs9email ::= IA5String (SIZE (1..ub-emailaddress-length))
193 -- naming data types --
195 Name ::= CHOICE { -- only one possibility for now --
196 rdnSequence RDNSequence }
198 RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
200 DistinguishedName ::= RDNSequence
202 RelativeDistinguishedName ::=
203 SET SIZE (1 .. MAX) OF AttributeTypeAndValue
207 -- --------------------------------------------------------
208 -- certificate and CRL specific structures begin here
209 -- --------------------------------------------------------
211 Certificate ::= SEQUENCE {
212 tbsCertificate TBSCertificate,
213 signatureAlgorithm AlgorithmIdentifier,
214 signature BIT STRING }
216 TBSCertificate ::= SEQUENCE {
217 version [0] EXPLICIT INTEGER DEFAULT 0,
218 serialNumber CertificateSerialNumber,
219 signature AlgorithmIdentifier,
223 subjectPublicKeyInfo SubjectPublicKeyInfo,
224 issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
225 -- If present, version shall be v2 or v3
226 subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
227 -- If present, version shall be v2 or v3
228 extensions [3] EXPLICIT Extensions OPTIONAL
229 -- If present, version shall be v3 --
232 CertificateSerialNumber ::= INTEGER
234 Validity ::= SEQUENCE {
240 generalTime GeneralizedTime }
242 UniqueIdentifier ::= BIT STRING
244 SubjectPublicKeyInfo ::= SEQUENCE {
245 algorithm AlgorithmIdentifier,
246 subjectPublicKey BIT STRING }
248 Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
250 Extension ::= SEQUENCE {
251 extnID OBJECT IDENTIFIER,
252 critical BOOLEAN DEFAULT FALSE,
253 extnValue OCTET STRING }
256 -- ------------------------------------------
258 -- ------------------------------------------
260 CertificateList ::= SEQUENCE {
261 tbsCertList TBSCertList,
262 signatureAlgorithm AlgorithmIdentifier,
263 signature BIT STRING }
265 TBSCertList ::= SEQUENCE {
266 version INTEGER OPTIONAL,
267 -- if present, shall be v2
268 signature AlgorithmIdentifier,
271 nextUpdate Time OPTIONAL,
272 revokedCertificates SEQUENCE OF SEQUENCE {
273 userCertificate CertificateSerialNumber,
275 crlEntryExtensions Extensions OPTIONAL
276 -- if present, shall be v2
278 crlExtensions [0] EXPLICIT Extensions OPTIONAL
279 -- if present, shall be v2 --
282 -- Version, Time, CertificateSerialNumber, and Extensions were
283 -- defined earlier for use in the certificate structure
285 AlgorithmIdentifier ::= SEQUENCE {
286 algorithm OBJECT IDENTIFIER,
287 parameters ANY DEFINED BY algorithm OPTIONAL }
288 -- contains a value of the type
289 -- registered for use with the
290 -- algorithm object identifier value
292 -- Algorithm OIDs and parameter structures
294 Dss-Sig-Value ::= SEQUENCE {
299 DomainParameters ::= SEQUENCE {
300 p INTEGER, -- odd prime, p=jq +1
301 g INTEGER, -- generator, g
302 q INTEGER, -- factor of p-1
303 j INTEGER OPTIONAL, -- subgroup factor, j>= 2
304 validationParms ValidationParms OPTIONAL }
306 ValidationParms ::= SEQUENCE {
308 pgenCounter INTEGER }
310 Dss-Parms ::= SEQUENCE {
315 -- x400 address syntax starts here
318 CountryName ::= [APPLICATION 1] CHOICE {
319 x121-dcc-code NumericString
320 (SIZE (ub-country-name-numeric-length)),
321 iso-3166-alpha2-code PrintableString
322 (SIZE (ub-country-name-alpha-length)) }
324 OrganizationName ::= PrintableString
325 (SIZE (1..ub-organization-name-length))
326 -- see also teletex-organization-name
328 NumericUserIdentifier ::= NumericString
329 (SIZE (1..ub-numeric-user-id-length))
331 -- see also teletex-personal-name
333 OrganizationalUnitNames ::= SEQUENCE SIZE (1..ub-organizational-units)
334 OF OrganizationalUnitName
335 -- see also teletex-organizational-unit-names
337 OrganizationalUnitName ::= PrintableString (SIZE
338 (1..ub-organizational-unit-name-length))
340 -- Extension types and attribute values
343 CommonName ::= PrintableString
345 -- END of PKIX1Implicit88
350 -- Cryptographic Message Syntax
352 pkcs-7-ContentInfo ::= SEQUENCE {
353 contentType pkcs-7-ContentType,
354 content [0] EXPLICIT ANY DEFINED BY contentType }
356 pkcs-7-DigestInfo ::= SEQUENCE {
357 digestAlgorithm AlgorithmIdentifier,
361 pkcs-7-ContentType ::= OBJECT IDENTIFIER
363 pkcs-7-SignedData ::= SEQUENCE {
365 digestAlgorithms pkcs-7-DigestAlgorithmIdentifiers,
366 encapContentInfo pkcs-7-EncapsulatedContentInfo,
367 certificates [0] IMPLICIT pkcs-7-CertificateSet OPTIONAL,
368 crls [1] IMPLICIT pkcs-7-CertificateRevocationLists OPTIONAL,
369 signerInfos pkcs-7-SignerInfos
372 pkcs-7-DigestAlgorithmIdentifiers ::= SET OF AlgorithmIdentifier
374 pkcs-7-EncapsulatedContentInfo ::= SEQUENCE {
375 eContentType pkcs-7-ContentType,
376 eContent [0] EXPLICIT OCTET STRING OPTIONAL }
378 -- We don't use CertificateList here since we only want
379 -- to read the raw data.
380 pkcs-7-CertificateRevocationLists ::= SET OF ANY
382 pkcs-7-CertificateChoices ::= CHOICE {
383 -- Although the paper uses Certificate type, we
384 -- don't use it since, we don't need to parse it.
385 -- We only need to read and store it.
389 pkcs-7-CertificateSet ::= SET OF pkcs-7-CertificateChoices
391 pkcs-7-SignerInfos ::= SET OF ANY -- this is not correct but we don't use it
397 -- Certificate requests
398 pkcs-10-CertificationRequestInfo ::= SEQUENCE {
401 subjectPKInfo SubjectPublicKeyInfo,
402 attributes [0] Attributes
405 Attributes ::= SET OF Attribute
407 pkcs-10-CertificationRequest ::= SEQUENCE {
408 certificationRequestInfo pkcs-10-CertificationRequestInfo,
409 signatureAlgorithm AlgorithmIdentifier,
415 pkcs-9-at-challengePassword OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 7}
417 pkcs-9-challengePassword ::= CHOICE {
418 printableString PrintableString,
419 utf8String UTF8String }
421 pkcs-9-localKeyId ::= OCTET STRING
425 -- Private-key information syntax
427 pkcs-8-PrivateKeyInfo ::= SEQUENCE {
429 privateKeyAlgorithm AlgorithmIdentifier,
430 privateKey OCTET STRING,
431 attributes [0] Attributes OPTIONAL }
433 pkcs-8-Attributes ::= SET OF Attribute
435 -- Encrypted private-key information syntax
437 pkcs-8-EncryptedPrivateKeyInfo ::= SEQUENCE {
438 encryptionAlgorithm AlgorithmIdentifier,
439 encryptedData pkcs-8-EncryptedData
442 pkcs-8-EncryptedData ::= OCTET STRING
446 pkcs-5-des-EDE3-CBC-params ::= OCTET STRING (SIZE(8))
447 pkcs-5-aes128-CBC-params ::= OCTET STRING (SIZE(16))
448 pkcs-5-aes192-CBC-params ::= OCTET STRING (SIZE(16))
449 pkcs-5-aes256-CBC-params ::= OCTET STRING (SIZE(16))
451 pkcs-5-PBES2-params ::= SEQUENCE {
452 keyDerivationFunc AlgorithmIdentifier,
453 encryptionScheme AlgorithmIdentifier }
457 -- pkcs-5-algid-hmacWithSHA1 AlgorithmIdentifier ::=
458 -- {algorithm pkcs-5-id-hmacWithSHA1, parameters NULL : NULL}
460 pkcs-5-PBKDF2-params ::= SEQUENCE {
462 specified OCTET STRING,
463 otherSource AlgorithmIdentifier
465 iterationCount INTEGER (1..MAX),
466 keyLength INTEGER (1..MAX) OPTIONAL,
467 prf AlgorithmIdentifier OPTIONAL -- DEFAULT pkcs-5-id-hmacWithSHA1
472 pkcs-12-PFX ::= SEQUENCE {
473 version INTEGER {v3(3)},
474 authSafe pkcs-7-ContentInfo,
475 macData pkcs-12-MacData OPTIONAL
478 pkcs-12-PbeParams ::= SEQUENCE {
483 pkcs-12-MacData ::= SEQUENCE {
484 mac pkcs-7-DigestInfo,
485 macSalt OCTET STRING,
486 iterations INTEGER DEFAULT 1
487 -- Note: The default is for historical reasons and its use is
488 -- deprecated. A higher value, like 1024 is recommended.
491 pkcs-12-AuthenticatedSafe ::= SEQUENCE OF pkcs-7-ContentInfo
492 -- Data if unencrypted
493 -- EncryptedData if password-encrypted
494 -- EnvelopedData if public key-encrypted
496 pkcs-12-SafeContents ::= SEQUENCE OF pkcs-12-SafeBag
498 pkcs-12-SafeBag ::= SEQUENCE {
499 bagId OBJECT IDENTIFIER,
500 bagValue [0] EXPLICIT ANY DEFINED BY badId,
501 bagAttributes SET OF Attribute OPTIONAL
506 pkcs-12-CertBag ::= SEQUENCE {
507 certId OBJECT IDENTIFIER,
508 certValue [0] EXPLICIT ANY DEFINED BY certId
511 -- x509Certificate BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-certTypes 1}}
512 -- DER-encoded X.509 certificate stored in OCTET STRING
514 pkcs-12-CRLBag ::= SEQUENCE {
515 crlId OBJECT IDENTIFIER,
516 crlValue [0] EXPLICIT ANY DEFINED BY crlId
519 pkcs-12-SecretBag ::= SEQUENCE {
520 secretTypeId OBJECT IDENTIFIER,
521 secretValue [0] EXPLICIT ANY DEFINED BY secretTypeId
524 -- x509CRL BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-crlTypes 1}}
525 -- DER-encoded X.509 CRL stored in OCTET STRING
527 -- PKCS #7 stuff (needed in PKCS 12)
529 pkcs-7-Data ::= OCTET STRING
531 pkcs-7-EncryptedData ::= SEQUENCE {
533 encryptedContentInfo pkcs-7-EncryptedContentInfo,
534 unprotectedAttrs [1] IMPLICIT pkcs-7-UnprotectedAttributes OPTIONAL }
536 pkcs-7-EncryptedContentInfo ::= SEQUENCE {
537 contentType pkcs-7-ContentType,
538 contentEncryptionAlgorithm pkcs-7-ContentEncryptionAlgorithmIdentifier,
539 encryptedContent [0] IMPLICIT OCTET STRING OPTIONAL }
541 pkcs-7-ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
543 pkcs-7-UnprotectedAttributes ::= SET SIZE (1..MAX) OF Attribute
547 ProxyCertInfo ::= SEQUENCE {
548 pCPathLenConstraint INTEGER (0..MAX) OPTIONAL,
549 proxyPolicy ProxyPolicy }
551 ProxyPolicy ::= SEQUENCE {
552 policyLanguage OBJECT IDENTIFIER,
553 policy OCTET STRING OPTIONAL }
557 OCSPRequest ::= SEQUENCE {
558 tbsRequest TBSRequest,
559 optionalSignature [0] EXPLICIT Signature OPTIONAL }
561 TBSRequest ::= SEQUENCE {
562 version [0] EXPLICIT INTEGER DEFAULT 0,
563 requestorName [1] EXPLICIT GeneralName OPTIONAL,
564 requestList SEQUENCE OF Request,
565 requestExtensions [2] EXPLICIT Extensions OPTIONAL }
567 Signature ::= SEQUENCE {
568 signatureAlgorithm AlgorithmIdentifier,
569 signature BIT STRING,
570 certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
572 Request ::= SEQUENCE {
574 singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL }
576 CertID ::= SEQUENCE {
577 hashAlgorithm AlgorithmIdentifier,
578 issuerNameHash OCTET STRING, -- Hash of Issuer's DN
579 issuerKeyHash OCTET STRING, -- Hash of Issuers public key
580 serialNumber CertificateSerialNumber }
582 OCSPResponse ::= SEQUENCE {
583 responseStatus OCSPResponseStatus,
584 responseBytes [0] EXPLICIT ResponseBytes OPTIONAL }
586 OCSPResponseStatus ::= ENUMERATED {
587 successful (0), --Response has valid confirmations
588 malformedRequest (1), --Illegal confirmation request
589 internalError (2), --Internal error in issuer
590 tryLater (3), --Try again later
592 sigRequired (5), --Must sign the request
593 unauthorized (6) --Request unauthorized
596 ResponseBytes ::= SEQUENCE {
597 responseType OBJECT IDENTIFIER,
598 response OCTET STRING }
600 BasicOCSPResponse ::= SEQUENCE {
601 tbsResponseData ResponseData,
602 signatureAlgorithm AlgorithmIdentifier,
603 signature BIT STRING,
604 certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
606 ResponseData ::= SEQUENCE {
607 version [0] EXPLICIT INTEGER DEFAULT 0,
608 responderID ResponderID,
609 producedAt GeneralizedTime,
610 responses SEQUENCE OF SingleResponse,
611 responseExtensions [1] EXPLICIT Extensions OPTIONAL }
613 ResponderID ::= CHOICE {
614 -- Changed to work with the libtasn1 parser.
615 byName [1] EXPLICIT RDNSequence, --Name
616 byKey [2] OCTET STRING --SHA-1 hash of responder's public key
619 SingleResponse ::= SEQUENCE {
621 certStatus CertStatus,
622 thisUpdate GeneralizedTime,
623 nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL,
624 singleExtensions [1] EXPLICIT Extensions OPTIONAL }
626 CertStatus ::= CHOICE {
627 good [0] IMPLICIT NULL,
628 revoked [1] IMPLICIT RevokedInfo,
629 unknown [2] IMPLICIT UnknownInfo }
631 RevokedInfo ::= SEQUENCE {
632 revocationTime GeneralizedTime,
633 revocationReason [0] EXPLICIT CRLReason OPTIONAL }
635 UnknownInfo ::= NULL -- this can be replaced with an enumeration
639 CRLReason ::= ENUMERATED {
643 affiliationChanged (3),
645 cessationOfOperation (5),
648 privilegeWithdrawn (9),