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 -- attribute data types --
131 Attribute ::= SEQUENCE {
133 values SET OF AttributeValue
134 -- at least one value is required --
137 AttributeType ::= OBJECT IDENTIFIER
139 AttributeValue ::= ANY DEFINED BY type
141 AttributeTypeAndValue ::= SEQUENCE {
143 value AttributeValue }
145 -- suggested naming attributes: Definition of the following
146 -- information object set may be augmented to meet local
147 -- requirements. Note that deleting members of the set may
148 -- prevent interoperability with conforming implementations.
149 -- presented in pairs: the AttributeType followed by the
150 -- type definition for the corresponding AttributeValue
152 -- Arc for standard naming attributes
153 id-at OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 4}
155 -- Attributes of type NameDirectoryString
157 -- gnutls: Note that the Object ID (id-at*) is being set just before the
158 -- actual definition. This is done in order for asn1_find_structure_from_oid
159 -- to work (locate structure from OID).
160 -- Maybe this is inefficient and memory consuming. Should we replace with
161 -- a table that maps OIDs to structures?
163 -- PostalAddress ::= SEQUENCE OF DirectoryString
167 emailAddress AttributeType ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 1 }
169 -- Pkcs9email ::= IA5String (SIZE (1..ub-emailaddress-length))
171 -- naming data types --
173 Name ::= CHOICE { -- only one possibility for now --
174 rdnSequence RDNSequence }
176 RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
178 DistinguishedName ::= RDNSequence
180 RelativeDistinguishedName ::=
181 SET SIZE (1 .. MAX) OF AttributeTypeAndValue
185 -- --------------------------------------------------------
186 -- certificate and CRL specific structures begin here
187 -- --------------------------------------------------------
189 Certificate ::= SEQUENCE {
190 tbsCertificate TBSCertificate,
191 signatureAlgorithm AlgorithmIdentifier,
192 signature BIT STRING }
194 TBSCertificate ::= SEQUENCE {
195 version [0] EXPLICIT INTEGER DEFAULT 0,
196 serialNumber CertificateSerialNumber,
197 signature AlgorithmIdentifier,
201 subjectPublicKeyInfo SubjectPublicKeyInfo,
202 issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
203 -- If present, version shall be v2 or v3
204 subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
205 -- If present, version shall be v2 or v3
206 extensions [3] EXPLICIT Extensions OPTIONAL
207 -- If present, version shall be v3 --
210 CertificateSerialNumber ::= INTEGER
212 Validity ::= SEQUENCE {
218 generalTime GeneralizedTime }
220 UniqueIdentifier ::= BIT STRING
222 SubjectPublicKeyInfo ::= SEQUENCE {
223 algorithm AlgorithmIdentifier,
224 subjectPublicKey BIT STRING }
226 Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
228 Extension ::= SEQUENCE {
229 extnID OBJECT IDENTIFIER,
230 critical BOOLEAN DEFAULT FALSE,
231 extnValue OCTET STRING }
234 -- ------------------------------------------
236 -- ------------------------------------------
238 CertificateList ::= SEQUENCE {
239 tbsCertList TBSCertList,
240 signatureAlgorithm AlgorithmIdentifier,
241 signature BIT STRING }
243 TBSCertList ::= SEQUENCE {
244 version INTEGER OPTIONAL,
245 -- if present, shall be v2
246 signature AlgorithmIdentifier,
249 nextUpdate Time OPTIONAL,
250 revokedCertificates SEQUENCE OF SEQUENCE {
251 userCertificate CertificateSerialNumber,
253 crlEntryExtensions Extensions OPTIONAL
254 -- if present, shall be v2
256 crlExtensions [0] EXPLICIT Extensions OPTIONAL
257 -- if present, shall be v2 --
260 -- Version, Time, CertificateSerialNumber, and Extensions were
261 -- defined earlier for use in the certificate structure
263 AlgorithmIdentifier ::= SEQUENCE {
264 algorithm OBJECT IDENTIFIER,
265 parameters ANY DEFINED BY algorithm OPTIONAL }
266 -- contains a value of the type
267 -- registered for use with the
268 -- algorithm object identifier value
270 -- Algorithm OIDs and parameter structures
272 Dss-Sig-Value ::= SEQUENCE {
277 DomainParameters ::= SEQUENCE {
278 p INTEGER, -- odd prime, p=jq +1
279 g INTEGER, -- generator, g
280 q INTEGER, -- factor of p-1
281 j INTEGER OPTIONAL, -- subgroup factor, j>= 2
282 validationParms ValidationParms OPTIONAL }
284 ValidationParms ::= SEQUENCE {
286 pgenCounter INTEGER }
288 Dss-Parms ::= SEQUENCE {
293 -- x400 address syntax starts here
296 CountryName ::= [APPLICATION 1] CHOICE {
297 x121-dcc-code NumericString
298 (SIZE (ub-country-name-numeric-length)),
299 iso-3166-alpha2-code PrintableString
300 (SIZE (ub-country-name-alpha-length)) }
302 OrganizationName ::= PrintableString
303 (SIZE (1..ub-organization-name-length))
304 -- see also teletex-organization-name
306 NumericUserIdentifier ::= NumericString
307 (SIZE (1..ub-numeric-user-id-length))
309 -- see also teletex-personal-name
311 OrganizationalUnitNames ::= SEQUENCE SIZE (1..ub-organizational-units)
312 OF OrganizationalUnitName
313 -- see also teletex-organizational-unit-names
315 OrganizationalUnitName ::= PrintableString (SIZE
316 (1..ub-organizational-unit-name-length))
318 -- Extension types and attribute values
321 CommonName ::= PrintableString
323 -- END of PKIX1Implicit88
328 -- Cryptographic Message Syntax
330 pkcs-7-ContentInfo ::= SEQUENCE {
331 contentType pkcs-7-ContentType,
332 content [0] EXPLICIT ANY DEFINED BY contentType }
334 pkcs-7-DigestInfo ::= SEQUENCE {
335 digestAlgorithm AlgorithmIdentifier,
339 pkcs-7-ContentType ::= OBJECT IDENTIFIER
341 pkcs-7-SignedData ::= SEQUENCE {
343 digestAlgorithms pkcs-7-DigestAlgorithmIdentifiers,
344 encapContentInfo pkcs-7-EncapsulatedContentInfo,
345 certificates [0] IMPLICIT pkcs-7-CertificateSet OPTIONAL,
346 crls [1] IMPLICIT pkcs-7-CertificateRevocationLists OPTIONAL,
347 signerInfos pkcs-7-SignerInfos
350 pkcs-7-DigestAlgorithmIdentifiers ::= SET OF AlgorithmIdentifier
352 pkcs-7-EncapsulatedContentInfo ::= SEQUENCE {
353 eContentType pkcs-7-ContentType,
354 eContent [0] EXPLICIT OCTET STRING OPTIONAL }
356 -- We don't use CertificateList here since we only want
357 -- to read the raw data.
358 pkcs-7-CertificateRevocationLists ::= SET OF ANY
360 pkcs-7-CertificateChoices ::= CHOICE {
361 -- Although the paper uses Certificate type, we
362 -- don't use it since, we don't need to parse it.
363 -- We only need to read and store it.
367 pkcs-7-CertificateSet ::= SET OF pkcs-7-CertificateChoices
369 pkcs-7-SignerInfos ::= SET OF ANY -- this is not correct but we don't use it
375 -- Certificate requests
376 pkcs-10-CertificationRequestInfo ::= SEQUENCE {
379 subjectPKInfo SubjectPublicKeyInfo,
380 attributes [0] Attributes
383 Attributes ::= SET OF Attribute
385 pkcs-10-CertificationRequest ::= SEQUENCE {
386 certificationRequestInfo pkcs-10-CertificationRequestInfo,
387 signatureAlgorithm AlgorithmIdentifier,
393 pkcs-9-at-challengePassword OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 7}
395 pkcs-9-challengePassword ::= CHOICE {
396 printableString PrintableString,
397 utf8String UTF8String }
399 pkcs-9-localKeyId ::= OCTET STRING
403 -- Private-key information syntax
405 pkcs-8-PrivateKeyInfo ::= SEQUENCE {
407 privateKeyAlgorithm AlgorithmIdentifier,
408 privateKey OCTET STRING,
409 attributes [0] Attributes OPTIONAL }
411 pkcs-8-Attributes ::= SET OF Attribute
413 -- Encrypted private-key information syntax
415 pkcs-8-EncryptedPrivateKeyInfo ::= SEQUENCE {
416 encryptionAlgorithm AlgorithmIdentifier,
417 encryptedData pkcs-8-EncryptedData
420 pkcs-8-EncryptedData ::= OCTET STRING
424 pkcs-5-des-EDE3-CBC-params ::= OCTET STRING (SIZE(8))
425 pkcs-5-aes128-CBC-params ::= OCTET STRING (SIZE(16))
426 pkcs-5-aes192-CBC-params ::= OCTET STRING (SIZE(16))
427 pkcs-5-aes256-CBC-params ::= OCTET STRING (SIZE(16))
429 pkcs-5-PBES2-params ::= SEQUENCE {
430 keyDerivationFunc AlgorithmIdentifier,
431 encryptionScheme AlgorithmIdentifier }
435 -- pkcs-5-algid-hmacWithSHA1 AlgorithmIdentifier ::=
436 -- {algorithm pkcs-5-id-hmacWithSHA1, parameters NULL : NULL}
438 pkcs-5-PBKDF2-params ::= SEQUENCE {
440 specified OCTET STRING,
441 otherSource AlgorithmIdentifier
443 iterationCount INTEGER (1..MAX),
444 keyLength INTEGER (1..MAX) OPTIONAL,
445 prf AlgorithmIdentifier OPTIONAL -- DEFAULT pkcs-5-id-hmacWithSHA1
450 pkcs-12-PFX ::= SEQUENCE {
451 version INTEGER {v3(3)},
452 authSafe pkcs-7-ContentInfo,
453 macData pkcs-12-MacData OPTIONAL
456 pkcs-12-PbeParams ::= SEQUENCE {
461 pkcs-12-MacData ::= SEQUENCE {
462 mac pkcs-7-DigestInfo,
463 macSalt OCTET STRING,
464 iterations INTEGER DEFAULT 1
465 -- Note: The default is for historical reasons and its use is
466 -- deprecated. A higher value, like 1024 is recommended.
469 pkcs-12-AuthenticatedSafe ::= SEQUENCE OF pkcs-7-ContentInfo
470 -- Data if unencrypted
471 -- EncryptedData if password-encrypted
472 -- EnvelopedData if public key-encrypted
474 pkcs-12-SafeContents ::= SEQUENCE OF pkcs-12-SafeBag
476 pkcs-12-SafeBag ::= SEQUENCE {
477 bagId OBJECT IDENTIFIER,
478 bagValue [0] EXPLICIT ANY DEFINED BY badId,
479 bagAttributes SET OF Attribute OPTIONAL
484 pkcs-12-CertBag ::= SEQUENCE {
485 certId OBJECT IDENTIFIER,
486 certValue [0] EXPLICIT ANY DEFINED BY certId
489 -- x509Certificate BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-certTypes 1}}
490 -- DER-encoded X.509 certificate stored in OCTET STRING
492 pkcs-12-CRLBag ::= SEQUENCE {
493 crlId OBJECT IDENTIFIER,
494 crlValue [0] EXPLICIT ANY DEFINED BY crlId
497 pkcs-12-SecretBag ::= SEQUENCE {
498 secretTypeId OBJECT IDENTIFIER,
499 secretValue [0] EXPLICIT ANY DEFINED BY secretTypeId
502 -- x509CRL BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-crlTypes 1}}
503 -- DER-encoded X.509 CRL stored in OCTET STRING
505 -- PKCS #7 stuff (needed in PKCS 12)
507 pkcs-7-Data ::= OCTET STRING
509 pkcs-7-EncryptedData ::= SEQUENCE {
511 encryptedContentInfo pkcs-7-EncryptedContentInfo,
512 unprotectedAttrs [1] IMPLICIT pkcs-7-UnprotectedAttributes OPTIONAL }
514 pkcs-7-EncryptedContentInfo ::= SEQUENCE {
515 contentType pkcs-7-ContentType,
516 contentEncryptionAlgorithm pkcs-7-ContentEncryptionAlgorithmIdentifier,
517 encryptedContent [0] IMPLICIT OCTET STRING OPTIONAL }
519 pkcs-7-ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
521 pkcs-7-UnprotectedAttributes ::= SET SIZE (1..MAX) OF Attribute
525 ProxyCertInfo ::= SEQUENCE {
526 pCPathLenConstraint INTEGER (0..MAX) OPTIONAL,
527 proxyPolicy ProxyPolicy }
529 ProxyPolicy ::= SEQUENCE {
530 policyLanguage OBJECT IDENTIFIER,
531 policy OCTET STRING OPTIONAL }
536 certificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
538 PolicyInformation ::= SEQUENCE {
539 policyIdentifier OBJECT IDENTIFIER,
540 policyQualifiers SEQUENCE SIZE (1..MAX) OF PolicyQualifierInfo OPTIONAL }
542 PolicyQualifierInfo ::= SEQUENCE {
543 policyQualifierId OBJECT IDENTIFIER,
544 qualifier ANY DEFINED BY policyQualifierId }
548 UserNotice ::= SEQUENCE {
549 noticeRef NoticeReference OPTIONAL,
550 explicitText DisplayText OPTIONAL }
552 NoticeReference ::= SEQUENCE {
553 organization DisplayText,
554 noticeNumbers SEQUENCE OF INTEGER }
556 DisplayText ::= CHOICE {
557 ia5String IA5String (SIZE (1..200)),
558 visibleString VisibleString (SIZE (1..200)),
559 bmpString BMPString (SIZE (1..200)),
560 utf8String UTF8String (SIZE (1..200)) }
564 OCSPRequest ::= SEQUENCE {
565 tbsRequest TBSRequest,
566 optionalSignature [0] EXPLICIT Signature OPTIONAL }
568 TBSRequest ::= SEQUENCE {
569 version [0] EXPLICIT INTEGER DEFAULT 0,
570 requestorName [1] EXPLICIT GeneralName OPTIONAL,
571 requestList SEQUENCE OF Request,
572 requestExtensions [2] EXPLICIT Extensions OPTIONAL }
574 Signature ::= SEQUENCE {
575 signatureAlgorithm AlgorithmIdentifier,
576 signature BIT STRING,
577 certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
579 Request ::= SEQUENCE {
581 singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL }
583 CertID ::= SEQUENCE {
584 hashAlgorithm AlgorithmIdentifier,
585 issuerNameHash OCTET STRING, -- Hash of Issuer's DN
586 issuerKeyHash OCTET STRING, -- Hash of Issuers public key
587 serialNumber CertificateSerialNumber }
589 OCSPResponse ::= SEQUENCE {
590 responseStatus OCSPResponseStatus,
591 responseBytes [0] EXPLICIT ResponseBytes OPTIONAL }
593 OCSPResponseStatus ::= ENUMERATED {
594 successful (0), --Response has valid confirmations
595 malformedRequest (1), --Illegal confirmation request
596 internalError (2), --Internal error in issuer
597 tryLater (3), --Try again later
599 sigRequired (5), --Must sign the request
600 unauthorized (6) --Request unauthorized
603 ResponseBytes ::= SEQUENCE {
604 responseType OBJECT IDENTIFIER,
605 response OCTET STRING }
607 BasicOCSPResponse ::= SEQUENCE {
608 tbsResponseData ResponseData,
609 signatureAlgorithm AlgorithmIdentifier,
610 signature BIT STRING,
611 certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
613 ResponseData ::= SEQUENCE {
614 version [0] EXPLICIT INTEGER DEFAULT 0,
615 responderID ResponderID,
616 producedAt GeneralizedTime,
617 responses SEQUENCE OF SingleResponse,
618 responseExtensions [1] EXPLICIT Extensions OPTIONAL }
620 ResponderID ::= CHOICE {
621 -- Changed to work with the libtasn1 parser.
622 byName [1] EXPLICIT RDNSequence, --Name
623 byKey [2] OCTET STRING --SHA-1 hash of responder's public key
626 SingleResponse ::= SEQUENCE {
628 certStatus CertStatus,
629 thisUpdate GeneralizedTime,
630 nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL,
631 singleExtensions [1] EXPLICIT Extensions OPTIONAL }
633 CertStatus ::= CHOICE {
634 good [0] IMPLICIT NULL,
635 revoked [1] IMPLICIT RevokedInfo,
636 unknown [2] IMPLICIT UnknownInfo }
638 RevokedInfo ::= SEQUENCE {
639 revocationTime GeneralizedTime,
640 revocationReason [0] EXPLICIT CRLReason OPTIONAL }
642 UnknownInfo ::= NULL -- this can be replaced with an enumeration
646 CRLReason ::= ENUMERATED {
650 affiliationChanged (3),
652 cessationOfOperation (5),
655 privilegeWithdrawn (9),