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 id-at-initials AttributeType ::= { id-at 43 }
173 X520initials ::= DirectoryString
175 id-at-generationQualifier AttributeType ::= { id-at 44 }
176 X520generationQualifier ::= DirectoryString
178 id-at-surname AttributeType ::= { id-at 4 }
179 X520surName ::= DirectoryString
181 id-at-givenName AttributeType ::= { id-at 42 }
182 X520givenName ::= DirectoryString
184 id-at-name AttributeType ::= { id-at 41 }
185 X520name ::= DirectoryString
187 id-at-commonName AttributeType ::= {id-at 3}
188 X520CommonName ::= DirectoryString
190 id-at-localityName AttributeType ::= {id-at 7}
191 X520LocalityName ::= DirectoryString
193 id-at-stateOrProvinceName AttributeType ::= {id-at 8}
194 X520StateOrProvinceName ::= DirectoryString
196 id-at-organizationName AttributeType ::= {id-at 10}
197 X520OrganizationName ::= DirectoryString
199 id-at-organizationalUnitName AttributeType ::= {id-at 11}
200 X520OrganizationalUnitName ::= DirectoryString
202 id-at-title AttributeType ::= {id-at 12}
203 X520Title ::= DirectoryString
205 id-at-description AttributeType ::= {id-at 13}
206 X520Description ::= DirectoryString
208 id-at-dnQualifier AttributeType ::= {id-at 46}
209 X520dnQualifier ::= PrintableString
211 id-at-countryName AttributeType ::= {id-at 6}
212 X520countryName ::= PrintableString (SIZE (2)) -- IS 3166 codes
214 id-at-serialNumber AttributeType ::= {id-at 5}
215 X520serialNumber ::= PrintableString
217 id-at-telephoneNumber AttributeType ::= {id-at 20}
218 X520telephoneNumber ::= PrintableString
220 id-at-facsimileTelephoneNumber AttributeType ::= {id-at 23}
221 X520facsimileTelephoneNumber ::= PrintableString
223 id-at-pseudonym AttributeType ::= {id-at 65}
224 X520pseudonym ::= DirectoryString
226 id-at-name AttributeType ::= {id-at 41}
227 X520name ::= DirectoryString
229 id-at-streetAddress AttributeType ::= {id-at 9}
230 X520streetAddress ::= DirectoryString
232 id-at-postalAddress AttributeType ::= {id-at 16}
233 X520postalAddress ::= PostalAddress
235 PostalAddress ::= SEQUENCE OF DirectoryString
239 emailAddress AttributeType ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 1 }
241 Pkcs9email ::= IA5String (SIZE (1..ub-emailaddress-length))
243 -- naming data types --
245 Name ::= CHOICE { -- only one possibility for now --
246 rdnSequence RDNSequence }
248 RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
250 DistinguishedName ::= RDNSequence
252 RelativeDistinguishedName ::=
253 SET SIZE (1 .. MAX) OF AttributeTypeAndValue
257 -- --------------------------------------------------------
258 -- certificate and CRL specific structures begin here
259 -- --------------------------------------------------------
261 Certificate ::= SEQUENCE {
262 tbsCertificate TBSCertificate,
263 signatureAlgorithm AlgorithmIdentifier,
264 signature BIT STRING }
266 TBSCertificate ::= SEQUENCE {
267 version [0] EXPLICIT Version DEFAULT v1,
268 serialNumber CertificateSerialNumber,
269 signature AlgorithmIdentifier,
273 subjectPublicKeyInfo SubjectPublicKeyInfo,
274 issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
275 -- If present, version shall be v2 or v3
276 subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
277 -- If present, version shall be v2 or v3
278 extensions [3] EXPLICIT Extensions OPTIONAL
279 -- If present, version shall be v3 --
282 Version ::= INTEGER { v1(0), v2(1), v3(2) }
284 CertificateSerialNumber ::= INTEGER
286 Validity ::= SEQUENCE {
292 generalTime GeneralizedTime }
294 UniqueIdentifier ::= BIT STRING
296 SubjectPublicKeyInfo ::= SEQUENCE {
297 algorithm AlgorithmIdentifier,
298 subjectPublicKey BIT STRING }
300 Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
302 Extension ::= SEQUENCE {
303 extnID OBJECT IDENTIFIER,
304 critical BOOLEAN DEFAULT FALSE,
305 extnValue OCTET STRING }
308 -- ------------------------------------------
310 -- ------------------------------------------
312 CertificateList ::= SEQUENCE {
313 tbsCertList TBSCertList,
314 signatureAlgorithm AlgorithmIdentifier,
315 signature BIT STRING }
317 TBSCertList ::= SEQUENCE {
318 version Version OPTIONAL,
319 -- if present, shall be v2
320 signature AlgorithmIdentifier,
323 nextUpdate Time OPTIONAL,
324 revokedCertificates SEQUENCE OF SEQUENCE {
325 userCertificate CertificateSerialNumber,
327 crlEntryExtensions Extensions OPTIONAL
328 -- if present, shall be v2
330 crlExtensions [0] EXPLICIT Extensions OPTIONAL
331 -- if present, shall be v2 --
334 -- Version, Time, CertificateSerialNumber, and Extensions were
335 -- defined earlier for use in the certificate structure
337 AlgorithmIdentifier ::= SEQUENCE {
338 algorithm OBJECT IDENTIFIER,
339 parameters ANY DEFINED BY algorithm OPTIONAL }
340 -- contains a value of the type
341 -- registered for use with the
342 -- algorithm object identifier value
344 -- Algorithm OIDs and parameter structures
346 Dss-Sig-Value ::= SEQUENCE {
351 DomainParameters ::= SEQUENCE {
352 p INTEGER, -- odd prime, p=jq +1
353 g INTEGER, -- generator, g
354 q INTEGER, -- factor of p-1
355 j INTEGER OPTIONAL, -- subgroup factor, j>= 2
356 validationParms ValidationParms OPTIONAL }
358 ValidationParms ::= SEQUENCE {
360 pgenCounter INTEGER }
362 Dss-Parms ::= SEQUENCE {
367 -- x400 address syntax starts here
370 CountryName ::= [APPLICATION 1] CHOICE {
371 x121-dcc-code NumericString
372 (SIZE (ub-country-name-numeric-length)),
373 iso-3166-alpha2-code PrintableString
374 (SIZE (ub-country-name-alpha-length)) }
376 OrganizationName ::= PrintableString
377 (SIZE (1..ub-organization-name-length))
378 -- see also teletex-organization-name
380 NumericUserIdentifier ::= NumericString
381 (SIZE (1..ub-numeric-user-id-length))
383 -- see also teletex-personal-name
385 OrganizationalUnitNames ::= SEQUENCE SIZE (1..ub-organizational-units)
386 OF OrganizationalUnitName
387 -- see also teletex-organizational-unit-names
389 OrganizationalUnitName ::= PrintableString (SIZE
390 (1..ub-organizational-unit-name-length))
392 -- Extension types and attribute values
395 CommonName ::= PrintableString
397 -- END of PKIX1Implicit88
402 -- Cryptographic Message Syntax
404 pkcs-7-ContentInfo ::= SEQUENCE {
405 contentType pkcs-7-ContentType,
406 content [0] EXPLICIT ANY DEFINED BY contentType }
408 pkcs-7-DigestInfo ::= SEQUENCE {
409 digestAlgorithm pkcs-7-DigestAlgorithmIdentifier,
413 pkcs-7-Digest ::= OCTET STRING
415 pkcs-7-ContentType ::= OBJECT IDENTIFIER
417 pkcs-7-SignedData ::= SEQUENCE {
418 version pkcs-7-CMSVersion,
419 digestAlgorithms pkcs-7-DigestAlgorithmIdentifiers,
420 encapContentInfo pkcs-7-EncapsulatedContentInfo,
421 certificates [0] IMPLICIT pkcs-7-CertificateSet OPTIONAL,
422 crls [1] IMPLICIT pkcs-7-CertificateRevocationLists OPTIONAL,
423 signerInfos pkcs-7-SignerInfos
426 pkcs-7-CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4) }
428 pkcs-7-DigestAlgorithmIdentifiers ::= SET OF pkcs-7-DigestAlgorithmIdentifier
430 pkcs-7-DigestAlgorithmIdentifier ::= AlgorithmIdentifier
432 pkcs-7-EncapsulatedContentInfo ::= SEQUENCE {
433 eContentType pkcs-7-ContentType,
434 eContent [0] EXPLICIT OCTET STRING OPTIONAL }
436 -- We don't use CertificateList here since we only want
437 -- to read the raw data.
438 pkcs-7-CertificateRevocationLists ::= SET OF ANY
440 pkcs-7-CertificateChoices ::= CHOICE {
441 -- Although the paper uses Certificate type, we
442 -- don't use it since, we don't need to parse it.
443 -- We only need to read and store it.
447 pkcs-7-CertificateSet ::= SET OF pkcs-7-CertificateChoices
449 pkcs-7-SignerInfos ::= SET OF ANY -- this is not correct but we don't use it
455 -- Certificate requests
456 pkcs-10-CertificationRequestInfo ::= SEQUENCE {
457 version INTEGER { v1(0) },
459 subjectPKInfo SubjectPublicKeyInfo,
460 attributes [0] Attributes
463 Attributes ::= SET OF Attribute
465 pkcs-10-CertificationRequest ::= SEQUENCE {
466 certificationRequestInfo pkcs-10-CertificationRequestInfo,
467 signatureAlgorithm AlgorithmIdentifier,
473 pkcs-9-at-challengePassword OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 7}
475 pkcs-9-challengePassword ::= CHOICE {
476 printableString PrintableString,
477 utf8String UTF8String }
479 pkcs-9-at-localKeyId OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 21}
481 pkcs-9-localKeyId ::= OCTET STRING
483 pkcs-9-at-friendlyName OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 20}
484 pkcs-9-friendlyName ::= BMPString (SIZE (1..255))
488 -- Private-key information syntax
490 pkcs-8-PrivateKeyInfo ::= SEQUENCE {
491 version pkcs-8-Version,
492 privateKeyAlgorithm AlgorithmIdentifier,
493 privateKey pkcs-8-PrivateKey,
494 attributes [0] Attributes OPTIONAL }
496 pkcs-8-Version ::= INTEGER {v1(0)}
498 pkcs-8-PrivateKey ::= OCTET STRING
500 pkcs-8-Attributes ::= SET OF Attribute
502 -- Encrypted private-key information syntax
504 pkcs-8-EncryptedPrivateKeyInfo ::= SEQUENCE {
505 encryptionAlgorithm AlgorithmIdentifier,
506 encryptedData pkcs-8-EncryptedData
509 pkcs-8-EncryptedData ::= OCTET STRING
513 pkcs-5-des-EDE3-CBC-params ::= OCTET STRING (SIZE(8))
514 pkcs-5-aes128-CBC-params ::= OCTET STRING (SIZE(16))
515 pkcs-5-aes192-CBC-params ::= OCTET STRING (SIZE(16))
516 pkcs-5-aes256-CBC-params ::= OCTET STRING (SIZE(16))
518 pkcs-5-PBES2-params ::= SEQUENCE {
519 keyDerivationFunc AlgorithmIdentifier,
520 encryptionScheme AlgorithmIdentifier }
524 -- pkcs-5-algid-hmacWithSHA1 AlgorithmIdentifier ::=
525 -- {algorithm pkcs-5-id-hmacWithSHA1, parameters NULL : NULL}
527 pkcs-5-PBKDF2-params ::= SEQUENCE {
529 specified OCTET STRING,
530 otherSource AlgorithmIdentifier
532 iterationCount INTEGER (1..MAX),
533 keyLength INTEGER (1..MAX) OPTIONAL,
534 prf AlgorithmIdentifier OPTIONAL -- DEFAULT pkcs-5-id-hmacWithSHA1
539 pkcs-12-PFX ::= SEQUENCE {
540 version INTEGER {v3(3)},
541 authSafe pkcs-7-ContentInfo,
542 macData pkcs-12-MacData OPTIONAL
545 pkcs-12-PbeParams ::= SEQUENCE {
550 pkcs-12-MacData ::= SEQUENCE {
551 mac pkcs-7-DigestInfo,
552 macSalt OCTET STRING,
553 iterations INTEGER DEFAULT 1
554 -- Note: The default is for historical reasons and its use is
555 -- deprecated. A higher value, like 1024 is recommended.
558 pkcs-12-AuthenticatedSafe ::= SEQUENCE OF pkcs-7-ContentInfo
559 -- Data if unencrypted
560 -- EncryptedData if password-encrypted
561 -- EnvelopedData if public key-encrypted
563 pkcs-12-SafeContents ::= SEQUENCE OF pkcs-12-SafeBag
565 pkcs-12-SafeBag ::= SEQUENCE {
566 bagId OBJECT IDENTIFIER,
567 bagValue [0] EXPLICIT ANY DEFINED BY badId,
568 bagAttributes SET OF pkcs-12-PKCS12Attribute OPTIONAL
573 pkcs-12-KeyBag ::= pkcs-8-PrivateKeyInfo
577 pkcs-12-PKCS8ShroudedKeyBag ::= pkcs-8-EncryptedPrivateKeyInfo
581 pkcs-12-CertBag ::= SEQUENCE {
582 certId OBJECT IDENTIFIER,
583 certValue [0] EXPLICIT ANY DEFINED BY certId
586 -- x509Certificate BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-certTypes 1}}
587 -- DER-encoded X.509 certificate stored in OCTET STRING
589 pkcs-12-CRLBag ::= SEQUENCE {
590 crlId OBJECT IDENTIFIER,
591 crlValue [0] EXPLICIT ANY DEFINED BY crlId
594 pkcs-12-SecretBag ::= SEQUENCE {
595 secretTypeId OBJECT IDENTIFIER,
596 secretValue [0] EXPLICIT ANY DEFINED BY secretTypeId
599 -- x509CRL BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-crlTypes 1}}
600 -- DER-encoded X.509 CRL stored in OCTET STRING
602 pkcs-12-PKCS12Attribute ::= Attribute
604 -- PKCS #7 stuff (needed in PKCS 12)
606 pkcs-7-Data ::= OCTET STRING
608 pkcs-7-EncryptedData ::= SEQUENCE {
609 version pkcs-7-CMSVersion,
610 encryptedContentInfo pkcs-7-EncryptedContentInfo,
611 unprotectedAttrs [1] IMPLICIT pkcs-7-UnprotectedAttributes OPTIONAL }
613 pkcs-7-EncryptedContentInfo ::= SEQUENCE {
614 contentType pkcs-7-ContentType,
615 contentEncryptionAlgorithm pkcs-7-ContentEncryptionAlgorithmIdentifier,
616 encryptedContent [0] IMPLICIT pkcs-7-EncryptedContent OPTIONAL }
618 pkcs-7-ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
620 pkcs-7-EncryptedContent ::= OCTET STRING
622 pkcs-7-UnprotectedAttributes ::= SET SIZE (1..MAX) OF Attribute
626 id-at-ldap-DC AttributeType ::= { 0 9 2342 19200300 100 1 25 }
627 ldap-DC ::= IA5String
629 id-at-ldap-UID AttributeType ::= { 0 9 2342 19200300 100 1 1 }
630 ldap-UID ::= DirectoryString
634 id-pda-dateOfBirth AttributeType ::= { id-pkix 9 1 }
635 DateOfBirth ::= GeneralizedTime
637 id-pda-placeOfBirth AttributeType ::= { id-pkix 9 2 }
638 PlaceOfBirth ::= DirectoryString
640 id-pda-gender AttributeType ::= { id-pkix 9 3 }
641 Gender ::= PrintableString (SIZE(1))
643 id-pda-countryOfCitizenship AttributeType ::= { id-pkix 9 4 }
644 CountryOfCitizenship ::= PrintableString (SIZE (2))
645 -- ISO 3166 Country Code
647 id-pda-countryOfResidence AttributeType ::= { id-pkix 9 5 }
648 CountryOfResidence ::= PrintableString (SIZE (2))
649 -- ISO 3166 Country Code
653 ProxyCertInfo ::= SEQUENCE {
654 pCPathLenConstraint INTEGER (0..MAX) OPTIONAL,
655 proxyPolicy ProxyPolicy }
657 ProxyPolicy ::= SEQUENCE {
658 policyLanguage OBJECT IDENTIFIER,
659 policy OCTET STRING OPTIONAL }
661 -- rfc3920 section 5.1.1
663 id-on-xmppAddr OBJECT IDENTIFIER ::= { id-pkix 8 5 }
665 XmppAddr ::= UTF8String