Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1138 lines
30 KiB

  1. /* Copyright (C) Microsoft Corporation, 1996-1999. All rights reserved. */
  2. /* ASN.1 definitions for X509 v3 certificates */
  3. #ifndef _X509_Module_H_
  4. #define _X509_Module_H_
  5. #include "msber.h"
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. typedef ASN1int32_t NoticeReference_noticeNumbers_Seq;
  10. typedef ASN1intx_t HUGEINTEGER;
  11. typedef ASN1bitstring_t BITSTRING;
  12. typedef ASN1octetstring_t OCTETSTRING;
  13. typedef ASN1open_t NOCOPYANY;
  14. typedef ASN1charstring_t NUMERICSTRING;
  15. typedef ASN1charstring_t PRINTABLESTRING;
  16. typedef ASN1charstring_t TELETEXSTRING;
  17. typedef ASN1charstring_t T61STRING;
  18. typedef ASN1charstring_t VIDEOTEXSTRING;
  19. typedef ASN1charstring_t IA5STRING;
  20. typedef ASN1charstring_t GRAPHICSTRING;
  21. typedef ASN1charstring_t VISIBLESTRING;
  22. typedef ASN1charstring_t ISO646STRING;
  23. typedef ASN1charstring_t GENERALSTRING;
  24. typedef ASN1char32string_t UNIVERSALSTRING;
  25. typedef ASN1char16string_t BMPSTRING;
  26. typedef ASN1wstring_t UTF8STRING;
  27. typedef ASN1encodedOID_t EncodedObjectID;
  28. #define EncodedObjectID_PDU 0
  29. #define SIZE_X509_Module_PDU_0 sizeof(EncodedObjectID)
  30. typedef BITSTRING Bits;
  31. #define Bits_PDU 1
  32. #define SIZE_X509_Module_PDU_1 sizeof(Bits)
  33. typedef ASN1int32_t CertificateVersion;
  34. #define CertificateVersion_v1 0
  35. #define CertificateVersion_v2 1
  36. #define CertificateVersion_v3 2
  37. typedef HUGEINTEGER CertificateSerialNumber;
  38. typedef BITSTRING UniqueIdentifier;
  39. typedef ASN1int32_t CRLVersion;
  40. #define CRLVersion_v1 0
  41. #define CRLVersion_v2 1
  42. typedef ASN1int32_t CertificationRequestInfoVersion;
  43. typedef OCTETSTRING KeyIdentifier;
  44. typedef BITSTRING KeyUsage;
  45. typedef EncodedObjectID CertPolicyElementId;
  46. typedef BITSTRING SubjectType;
  47. typedef BITSTRING ReasonFlags;
  48. typedef ASN1int32_t IntegerType;
  49. #define IntegerType_PDU 2
  50. #define SIZE_X509_Module_PDU_2 sizeof(IntegerType)
  51. typedef HUGEINTEGER HugeIntegerType;
  52. #define HugeIntegerType_PDU 3
  53. #define SIZE_X509_Module_PDU_3 sizeof(HugeIntegerType)
  54. typedef OCTETSTRING OctetStringType;
  55. #define OctetStringType_PDU 4
  56. #define SIZE_X509_Module_PDU_4 sizeof(OctetStringType)
  57. typedef enum EnumeratedType {
  58. dummyEnumerated0 = 0,
  59. } EnumeratedType;
  60. #define EnumeratedType_PDU 5
  61. #define SIZE_X509_Module_PDU_5 sizeof(EnumeratedType)
  62. typedef ASN1utctime_t UtcTime;
  63. #define UtcTime_PDU 6
  64. #define SIZE_X509_Module_PDU_6 sizeof(UtcTime)
  65. typedef EncodedObjectID ContentType;
  66. typedef EncodedObjectID UsageIdentifier;
  67. typedef ASN1int32_t CTLVersion;
  68. #define CTLVersion_v1 0
  69. typedef OCTETSTRING ListIdentifier;
  70. typedef OCTETSTRING SubjectIdentifier;
  71. typedef ASN1uint32_t BaseDistance;
  72. typedef ASN1uint32_t SkipCerts;
  73. typedef ASN1uint32_t BodyPartID;
  74. typedef ASN1uint32_t TemplateVersion;
  75. typedef struct NoticeReference_noticeNumbers {
  76. ASN1uint32_t count;
  77. NoticeReference_noticeNumbers_Seq *value;
  78. } NoticeReference_noticeNumbers;
  79. typedef struct AnyString {
  80. ASN1choice_t choice;
  81. union {
  82. # define octetString_chosen 1
  83. OCTETSTRING octetString;
  84. # define utf8String_chosen 2
  85. UTF8STRING utf8String;
  86. # define numericString_chosen 3
  87. NUMERICSTRING numericString;
  88. # define printableString_chosen 4
  89. PRINTABLESTRING printableString;
  90. # define teletexString_chosen 5
  91. TELETEXSTRING teletexString;
  92. # define videotexString_chosen 6
  93. VIDEOTEXSTRING videotexString;
  94. # define ia5String_chosen 7
  95. IA5STRING ia5String;
  96. # define graphicString_chosen 8
  97. GRAPHICSTRING graphicString;
  98. # define visibleString_chosen 9
  99. VISIBLESTRING visibleString;
  100. # define generalString_chosen 10
  101. GENERALSTRING generalString;
  102. # define universalString_chosen 11
  103. UNIVERSALSTRING universalString;
  104. # define bmpString_chosen 12
  105. BMPSTRING bmpString;
  106. } u;
  107. } AnyString;
  108. #define AnyString_PDU 7
  109. #define SIZE_X509_Module_PDU_7 sizeof(AnyString)
  110. typedef struct AlgorithmIdentifier {
  111. union {
  112. ASN1uint16_t bit_mask;
  113. ASN1octet_t o[1];
  114. };
  115. EncodedObjectID algorithm;
  116. # define parameters_present 0x80
  117. NOCOPYANY parameters;
  118. } AlgorithmIdentifier;
  119. typedef struct Name {
  120. ASN1uint32_t count;
  121. struct RelativeDistinguishedName *value;
  122. } Name;
  123. #define Name_PDU 8
  124. #define SIZE_X509_Module_PDU_8 sizeof(Name)
  125. typedef struct RelativeDistinguishedName {
  126. ASN1uint32_t count;
  127. struct AttributeTypeValue *value;
  128. } RelativeDistinguishedName;
  129. typedef struct AttributeTypeValue {
  130. EncodedObjectID type;
  131. NOCOPYANY value;
  132. } AttributeTypeValue;
  133. typedef struct AttributeSetValue {
  134. ASN1uint32_t count;
  135. NOCOPYANY *value;
  136. } AttributeSetValue;
  137. typedef struct Attributes {
  138. ASN1uint32_t count;
  139. struct Attribute *value;
  140. } Attributes;
  141. #define Attributes_PDU 9
  142. #define SIZE_X509_Module_PDU_9 sizeof(Attributes)
  143. typedef struct RSAPublicKey {
  144. HUGEINTEGER modulus;
  145. ASN1uint32_t publicExponent;
  146. } RSAPublicKey;
  147. #define RSAPublicKey_PDU 10
  148. #define SIZE_X509_Module_PDU_10 sizeof(RSAPublicKey)
  149. typedef struct DSSParameters {
  150. HUGEINTEGER p;
  151. HUGEINTEGER q;
  152. HUGEINTEGER g;
  153. } DSSParameters;
  154. #define DSSParameters_PDU 11
  155. #define SIZE_X509_Module_PDU_11 sizeof(DSSParameters)
  156. typedef struct DSSSignature {
  157. HUGEINTEGER r;
  158. HUGEINTEGER s;
  159. } DSSSignature;
  160. #define DSSSignature_PDU 12
  161. #define SIZE_X509_Module_PDU_12 sizeof(DSSSignature)
  162. typedef struct DHParameters {
  163. union {
  164. ASN1uint16_t bit_mask;
  165. ASN1octet_t o[1];
  166. };
  167. HUGEINTEGER p;
  168. HUGEINTEGER g;
  169. # define privateValueLength_present 0x80
  170. HUGEINTEGER privateValueLength;
  171. } DHParameters;
  172. #define DHParameters_PDU 13
  173. #define SIZE_X509_Module_PDU_13 sizeof(DHParameters)
  174. typedef struct X942DhValidationParams {
  175. BITSTRING seed;
  176. ASN1uint32_t pgenCounter;
  177. } X942DhValidationParams;
  178. typedef struct X942DhKeySpecificInfo {
  179. EncodedObjectID algorithm;
  180. OCTETSTRING counter;
  181. } X942DhKeySpecificInfo;
  182. typedef struct RC2CBCParameters {
  183. union {
  184. ASN1uint16_t bit_mask;
  185. ASN1octet_t o[1];
  186. };
  187. ASN1int32_t version;
  188. # define iv_present 0x80
  189. OCTETSTRING iv;
  190. } RC2CBCParameters;
  191. #define RC2CBCParameters_PDU 14
  192. #define SIZE_X509_Module_PDU_14 sizeof(RC2CBCParameters)
  193. typedef struct SMIMECapability {
  194. union {
  195. ASN1uint16_t bit_mask;
  196. ASN1octet_t o[1];
  197. };
  198. EncodedObjectID capabilityID;
  199. # define smimeParameters_present 0x80
  200. NOCOPYANY smimeParameters;
  201. } SMIMECapability;
  202. typedef struct SMIMECapabilities {
  203. ASN1uint32_t count;
  204. struct SMIMECapability *value;
  205. } SMIMECapabilities;
  206. #define SMIMECapabilities_PDU 15
  207. #define SIZE_X509_Module_PDU_15 sizeof(SMIMECapabilities)
  208. typedef struct SubjectPublicKeyInfo {
  209. AlgorithmIdentifier algorithm;
  210. BITSTRING subjectPublicKey;
  211. } SubjectPublicKeyInfo;
  212. #define SubjectPublicKeyInfo_PDU 16
  213. #define SIZE_X509_Module_PDU_16 sizeof(SubjectPublicKeyInfo)
  214. typedef struct ChoiceOfTime {
  215. ASN1choice_t choice;
  216. union {
  217. # define utcTime_chosen 1
  218. ASN1utctime_t utcTime;
  219. # define generalTime_chosen 2
  220. ASN1generalizedtime_t generalTime;
  221. } u;
  222. } ChoiceOfTime;
  223. #define ChoiceOfTime_PDU 17
  224. #define SIZE_X509_Module_PDU_17 sizeof(ChoiceOfTime)
  225. typedef struct Validity {
  226. ChoiceOfTime notBefore;
  227. ChoiceOfTime notAfter;
  228. } Validity;
  229. typedef struct Extensions {
  230. ASN1uint32_t count;
  231. struct Extension *value;
  232. } Extensions;
  233. #define Extensions_PDU 18
  234. #define SIZE_X509_Module_PDU_18 sizeof(Extensions)
  235. typedef struct Extension {
  236. union {
  237. ASN1uint16_t bit_mask;
  238. ASN1octet_t o[1];
  239. };
  240. EncodedObjectID extnId;
  241. # define critical_present 0x80
  242. ASN1bool_t critical;
  243. OCTETSTRING extnValue;
  244. } Extension;
  245. typedef struct SignedContent {
  246. NOCOPYANY toBeSigned;
  247. AlgorithmIdentifier algorithm;
  248. BITSTRING signature;
  249. } SignedContent;
  250. #define SignedContent_PDU 19
  251. #define SIZE_X509_Module_PDU_19 sizeof(SignedContent)
  252. typedef struct RevokedCertificates {
  253. ASN1uint32_t count;
  254. struct CRLEntry *value;
  255. } RevokedCertificates;
  256. typedef struct CRLEntry {
  257. union {
  258. ASN1uint16_t bit_mask;
  259. ASN1octet_t o[1];
  260. };
  261. CertificateSerialNumber userCertificate;
  262. ChoiceOfTime revocationDate;
  263. # define crlEntryExtensions_present 0x80
  264. Extensions crlEntryExtensions;
  265. } CRLEntry;
  266. typedef struct CertificationRequestInfo {
  267. CertificationRequestInfoVersion version;
  268. NOCOPYANY subject;
  269. SubjectPublicKeyInfo subjectPublicKeyInfo;
  270. Attributes attributes;
  271. } CertificationRequestInfo;
  272. #define CertificationRequestInfo_PDU 20
  273. #define SIZE_X509_Module_PDU_20 sizeof(CertificationRequestInfo)
  274. typedef struct CertificationRequestInfoDecode {
  275. union {
  276. ASN1uint16_t bit_mask;
  277. ASN1octet_t o[1];
  278. };
  279. CertificationRequestInfoVersion version;
  280. NOCOPYANY subject;
  281. SubjectPublicKeyInfo subjectPublicKeyInfo;
  282. # define attributes_present 0x80
  283. Attributes attributes;
  284. } CertificationRequestInfoDecode;
  285. #define CertificationRequestInfoDecode_PDU 21
  286. #define SIZE_X509_Module_PDU_21 sizeof(CertificationRequestInfoDecode)
  287. typedef struct KeygenRequestInfo {
  288. SubjectPublicKeyInfo subjectPublicKeyInfo;
  289. IA5STRING challenge;
  290. } KeygenRequestInfo;
  291. #define KeygenRequestInfo_PDU 22
  292. #define SIZE_X509_Module_PDU_22 sizeof(KeygenRequestInfo)
  293. typedef struct AuthorityKeyId {
  294. union {
  295. ASN1uint16_t bit_mask;
  296. ASN1octet_t o[1];
  297. };
  298. # define AuthorityKeyId_keyIdentifier_present 0x80
  299. KeyIdentifier keyIdentifier;
  300. # define certIssuer_present 0x40
  301. NOCOPYANY certIssuer;
  302. # define certSerialNumber_present 0x20
  303. CertificateSerialNumber certSerialNumber;
  304. } AuthorityKeyId;
  305. #define AuthorityKeyId_PDU 23
  306. #define SIZE_X509_Module_PDU_23 sizeof(AuthorityKeyId)
  307. typedef struct PrivateKeyValidity {
  308. union {
  309. ASN1uint16_t bit_mask;
  310. ASN1octet_t o[1];
  311. };
  312. # define notBefore_present 0x80
  313. ASN1generalizedtime_t notBefore;
  314. # define notAfter_present 0x40
  315. ASN1generalizedtime_t notAfter;
  316. } PrivateKeyValidity;
  317. typedef struct CertPolicySet {
  318. ASN1uint32_t count;
  319. struct CertPolicyId *value;
  320. } CertPolicySet;
  321. typedef struct CertPolicyId {
  322. ASN1uint32_t count;
  323. CertPolicyElementId *value;
  324. } CertPolicyId;
  325. typedef struct AltNames {
  326. ASN1uint32_t count;
  327. struct GeneralName *value;
  328. } AltNames;
  329. #define AltNames_PDU 24
  330. #define SIZE_X509_Module_PDU_24 sizeof(AltNames)
  331. typedef AltNames GeneralNames;
  332. typedef struct OtherName {
  333. EncodedObjectID type;
  334. NOCOPYANY value;
  335. } OtherName;
  336. typedef struct EDIPartyName {
  337. union {
  338. ASN1uint16_t bit_mask;
  339. ASN1octet_t o[1];
  340. };
  341. # define nameAssigner_present 0x80
  342. NOCOPYANY nameAssigner;
  343. NOCOPYANY partyName;
  344. } EDIPartyName;
  345. #define EDIPartyName_PDU 25
  346. #define SIZE_X509_Module_PDU_25 sizeof(EDIPartyName)
  347. typedef struct SubtreesConstraint {
  348. ASN1uint32_t count;
  349. NOCOPYANY *value;
  350. } SubtreesConstraint;
  351. typedef struct BasicConstraints2 {
  352. union {
  353. ASN1uint16_t bit_mask;
  354. ASN1octet_t o[1];
  355. };
  356. # define cA_present 0x80
  357. ASN1bool_t cA;
  358. # define BasicConstraints2_pathLenConstraint_present 0x40
  359. ASN1int32_t pathLenConstraint;
  360. } BasicConstraints2;
  361. #define BasicConstraints2_PDU 26
  362. #define SIZE_X509_Module_PDU_26 sizeof(BasicConstraints2)
  363. typedef struct CertificatePolicies {
  364. ASN1uint32_t count;
  365. struct PolicyInformation *value;
  366. } CertificatePolicies;
  367. #define CertificatePolicies_PDU 27
  368. #define SIZE_X509_Module_PDU_27 sizeof(CertificatePolicies)
  369. typedef struct PolicyQualifiers {
  370. ASN1uint32_t count;
  371. struct PolicyQualifierInfo *value;
  372. } PolicyQualifiers;
  373. typedef struct PolicyQualifierInfo {
  374. union {
  375. ASN1uint16_t bit_mask;
  376. ASN1octet_t o[1];
  377. };
  378. EncodedObjectID policyQualifierId;
  379. # define qualifier_present 0x80
  380. NOCOPYANY qualifier;
  381. } PolicyQualifierInfo;
  382. typedef struct NoticeReference {
  383. ASN1ztcharstring_t organization;
  384. NoticeReference_noticeNumbers noticeNumbers;
  385. } NoticeReference;
  386. typedef struct DisplayText {
  387. ASN1choice_t choice;
  388. union {
  389. # define theVisibleString_chosen 1
  390. ASN1ztcharstring_t theVisibleString;
  391. # define theBMPString_chosen 2
  392. ASN1char16string_t theBMPString;
  393. } u;
  394. } DisplayText;
  395. typedef struct CertificatePolicies95 {
  396. ASN1uint32_t count;
  397. struct PolicyQualifiers *value;
  398. } CertificatePolicies95;
  399. #define CertificatePolicies95_PDU 28
  400. #define SIZE_X509_Module_PDU_28 sizeof(CertificatePolicies95)
  401. typedef struct CpsURLs {
  402. ASN1uint32_t count;
  403. struct CpsURLs_Seq *value;
  404. } CpsURLs;
  405. typedef struct AuthorityKeyId2 {
  406. union {
  407. ASN1uint16_t bit_mask;
  408. ASN1octet_t o[1];
  409. };
  410. # define AuthorityKeyId2_keyIdentifier_present 0x80
  411. KeyIdentifier keyIdentifier;
  412. # define authorityCertIssuer_present 0x40
  413. GeneralNames authorityCertIssuer;
  414. # define authorityCertSerialNumber_present 0x20
  415. CertificateSerialNumber authorityCertSerialNumber;
  416. } AuthorityKeyId2;
  417. #define AuthorityKeyId2_PDU 29
  418. #define SIZE_X509_Module_PDU_29 sizeof(AuthorityKeyId2)
  419. typedef struct AuthorityInfoAccess {
  420. ASN1uint32_t count;
  421. struct AccessDescription *value;
  422. } AuthorityInfoAccess;
  423. #define AuthorityInfoAccess_PDU 30
  424. #define SIZE_X509_Module_PDU_30 sizeof(AuthorityInfoAccess)
  425. typedef struct CRLDistributionPoints {
  426. ASN1uint32_t count;
  427. struct DistributionPoint *value;
  428. } CRLDistributionPoints;
  429. #define CRLDistributionPoints_PDU 31
  430. #define SIZE_X509_Module_PDU_31 sizeof(CRLDistributionPoints)
  431. typedef struct DistributionPointName {
  432. ASN1choice_t choice;
  433. union {
  434. # define fullName_chosen 1
  435. GeneralNames fullName;
  436. # define nameRelativeToCRLIssuer_chosen 2
  437. RelativeDistinguishedName nameRelativeToCRLIssuer;
  438. } u;
  439. } DistributionPointName;
  440. typedef struct ContentInfo {
  441. union {
  442. ASN1uint16_t bit_mask;
  443. ASN1octet_t o[1];
  444. };
  445. ContentType contentType;
  446. # define content_present 0x80
  447. NOCOPYANY content;
  448. } ContentInfo;
  449. #define ContentInfo_PDU 32
  450. #define SIZE_X509_Module_PDU_32 sizeof(ContentInfo)
  451. typedef struct SeqOfAny {
  452. ASN1uint32_t count;
  453. NOCOPYANY *value;
  454. } SeqOfAny;
  455. #define SeqOfAny_PDU 33
  456. #define SIZE_X509_Module_PDU_33 sizeof(SeqOfAny)
  457. typedef struct TimeStampRequest {
  458. union {
  459. ASN1uint16_t bit_mask;
  460. ASN1octet_t o[1];
  461. };
  462. EncodedObjectID timeStampAlgorithm;
  463. # define attributesTS_present 0x80
  464. Attributes attributesTS;
  465. ContentInfo content;
  466. } TimeStampRequest;
  467. #define TimeStampRequest_PDU 34
  468. #define SIZE_X509_Module_PDU_34 sizeof(TimeStampRequest)
  469. typedef struct ContentInfoOTS {
  470. union {
  471. ASN1uint16_t bit_mask;
  472. ASN1octet_t o[1];
  473. };
  474. ContentType contentTypeOTS;
  475. # define contentOTS_present 0x80
  476. OCTETSTRING contentOTS;
  477. } ContentInfoOTS;
  478. #define ContentInfoOTS_PDU 35
  479. #define SIZE_X509_Module_PDU_35 sizeof(ContentInfoOTS)
  480. typedef struct TimeStampRequestOTS {
  481. union {
  482. ASN1uint16_t bit_mask;
  483. ASN1octet_t o[1];
  484. };
  485. EncodedObjectID timeStampAlgorithmOTS;
  486. # define attributesOTS_present 0x80
  487. Attributes attributesOTS;
  488. ContentInfoOTS contentOTS;
  489. } TimeStampRequestOTS;
  490. #define TimeStampRequestOTS_PDU 36
  491. #define SIZE_X509_Module_PDU_36 sizeof(TimeStampRequestOTS)
  492. typedef struct EnhancedKeyUsage {
  493. ASN1uint32_t count;
  494. UsageIdentifier *value;
  495. } EnhancedKeyUsage;
  496. #define EnhancedKeyUsage_PDU 37
  497. #define SIZE_X509_Module_PDU_37 sizeof(EnhancedKeyUsage)
  498. typedef EnhancedKeyUsage SubjectUsage;
  499. typedef struct TrustedSubjects {
  500. ASN1uint32_t count;
  501. struct TrustedSubject *value;
  502. } TrustedSubjects;
  503. typedef struct TrustedSubject {
  504. union {
  505. ASN1uint16_t bit_mask;
  506. ASN1octet_t o[1];
  507. };
  508. SubjectIdentifier subjectIdentifier;
  509. # define subjectAttributes_present 0x80
  510. Attributes subjectAttributes;
  511. } TrustedSubject;
  512. typedef struct EnrollmentNameValuePair {
  513. BMPSTRING name;
  514. BMPSTRING value;
  515. } EnrollmentNameValuePair;
  516. #define EnrollmentNameValuePair_PDU 38
  517. #define SIZE_X509_Module_PDU_38 sizeof(EnrollmentNameValuePair)
  518. typedef struct CSPProvider {
  519. ASN1int32_t keySpec;
  520. BMPSTRING cspName;
  521. BITSTRING signature;
  522. } CSPProvider;
  523. #define CSPProvider_PDU 39
  524. #define SIZE_X509_Module_PDU_39 sizeof(CSPProvider)
  525. typedef struct CertificatePair {
  526. union {
  527. ASN1uint16_t bit_mask;
  528. ASN1octet_t o[1];
  529. };
  530. # define forward_present 0x80
  531. NOCOPYANY forward;
  532. # define reverse_present 0x40
  533. NOCOPYANY reverse;
  534. } CertificatePair;
  535. #define CertificatePair_PDU 40
  536. #define SIZE_X509_Module_PDU_40 sizeof(CertificatePair)
  537. typedef struct GeneralSubtrees {
  538. ASN1uint32_t count;
  539. struct GeneralSubtree *value;
  540. } GeneralSubtrees;
  541. typedef struct IssuingDistributionPoint {
  542. union {
  543. ASN1uint16_t bit_mask;
  544. ASN1octet_t o[1];
  545. };
  546. # define issuingDistributionPoint_present 0x80
  547. DistributionPointName issuingDistributionPoint;
  548. # define onlyContainsUserCerts_present 0x40
  549. ASN1bool_t onlyContainsUserCerts;
  550. # define onlyContainsCACerts_present 0x20
  551. ASN1bool_t onlyContainsCACerts;
  552. # define onlySomeReasons_present 0x10
  553. ReasonFlags onlySomeReasons;
  554. # define indirectCRL_present 0x8
  555. ASN1bool_t indirectCRL;
  556. } IssuingDistributionPoint;
  557. #define IssuingDistributionPoint_PDU 41
  558. #define SIZE_X509_Module_PDU_41 sizeof(IssuingDistributionPoint)
  559. typedef struct CrossCertDistPointNames {
  560. ASN1uint32_t count;
  561. GeneralNames *value;
  562. } CrossCertDistPointNames;
  563. typedef struct PolicyMappings {
  564. ASN1uint32_t count;
  565. struct PolicyMapping *value;
  566. } PolicyMappings;
  567. #define PolicyMappings_PDU 42
  568. #define SIZE_X509_Module_PDU_42 sizeof(PolicyMappings)
  569. typedef struct PolicyMapping {
  570. EncodedObjectID issuerDomainPolicy;
  571. EncodedObjectID subjectDomainPolicy;
  572. } PolicyMapping;
  573. typedef struct PolicyConstraints {
  574. union {
  575. ASN1uint16_t bit_mask;
  576. ASN1octet_t o[1];
  577. };
  578. # define requireExplicitPolicy_present 0x80
  579. SkipCerts requireExplicitPolicy;
  580. # define inhibitPolicyMapping_present 0x40
  581. SkipCerts inhibitPolicyMapping;
  582. } PolicyConstraints;
  583. #define PolicyConstraints_PDU 43
  584. #define SIZE_X509_Module_PDU_43 sizeof(PolicyConstraints)
  585. typedef struct ControlSequence {
  586. ASN1uint32_t count;
  587. struct TaggedAttribute *value;
  588. } ControlSequence;
  589. typedef struct ReqSequence {
  590. ASN1uint32_t count;
  591. struct TaggedRequest *value;
  592. } ReqSequence;
  593. typedef struct CmsSequence {
  594. ASN1uint32_t count;
  595. struct TaggedContentInfo *value;
  596. } CmsSequence;
  597. typedef struct OtherMsgSequence {
  598. ASN1uint32_t count;
  599. struct TaggedOtherMsg *value;
  600. } OtherMsgSequence;
  601. typedef struct BodyPartIDSequence {
  602. ASN1uint32_t count;
  603. BodyPartID *value;
  604. } BodyPartIDSequence;
  605. typedef struct TaggedAttribute {
  606. BodyPartID bodyPartID;
  607. EncodedObjectID type;
  608. AttributeSetValue values;
  609. } TaggedAttribute;
  610. typedef struct TaggedCertificationRequest {
  611. BodyPartID bodyPartID;
  612. NOCOPYANY certificationRequest;
  613. } TaggedCertificationRequest;
  614. typedef struct TaggedContentInfo {
  615. BodyPartID bodyPartID;
  616. NOCOPYANY contentInfo;
  617. } TaggedContentInfo;
  618. typedef struct TaggedOtherMsg {
  619. BodyPartID bodyPartID;
  620. EncodedObjectID otherMsgType;
  621. NOCOPYANY otherMsgValue;
  622. } TaggedOtherMsg;
  623. typedef struct PendInfo {
  624. OCTETSTRING pendToken;
  625. ASN1generalizedtime_t pendTime;
  626. } PendInfo;
  627. typedef struct CmcAddExtensions {
  628. BodyPartID pkiDataReference;
  629. BodyPartIDSequence certReferences;
  630. Extensions extensions;
  631. } CmcAddExtensions;
  632. #define CmcAddExtensions_PDU 44
  633. #define SIZE_X509_Module_PDU_44 sizeof(CmcAddExtensions)
  634. typedef struct CmcAddAttributes {
  635. BodyPartID pkiDataReference;
  636. BodyPartIDSequence certReferences;
  637. Attributes attributes;
  638. } CmcAddAttributes;
  639. #define CmcAddAttributes_PDU 45
  640. #define SIZE_X509_Module_PDU_45 sizeof(CmcAddAttributes)
  641. typedef struct CertificateTemplate {
  642. union {
  643. ASN1uint16_t bit_mask;
  644. ASN1octet_t o[1];
  645. };
  646. EncodedObjectID templateID;
  647. TemplateVersion templateMajorVersion;
  648. # define templateMinorVersion_present 0x80
  649. TemplateVersion templateMinorVersion;
  650. } CertificateTemplate;
  651. #define CertificateTemplate_PDU 46
  652. #define SIZE_X509_Module_PDU_46 sizeof(CertificateTemplate)
  653. typedef struct CmcStatusInfo_otherInfo {
  654. ASN1choice_t choice;
  655. union {
  656. # define failInfo_chosen 1
  657. ASN1uint32_t failInfo;
  658. # define pendInfo_chosen 2
  659. PendInfo pendInfo;
  660. } u;
  661. } CmcStatusInfo_otherInfo;
  662. typedef struct CpsURLs_Seq {
  663. union {
  664. ASN1uint16_t bit_mask;
  665. ASN1octet_t o[1];
  666. };
  667. ASN1ztcharstring_t url;
  668. # define digestAlgorithmId_present 0x80
  669. AlgorithmIdentifier digestAlgorithmId;
  670. # define digest_present 0x40
  671. OCTETSTRING digest;
  672. } CpsURLs_Seq;
  673. typedef struct Attribute {
  674. EncodedObjectID type;
  675. AttributeSetValue values;
  676. } Attribute;
  677. #define Attribute_PDU 47
  678. #define SIZE_X509_Module_PDU_47 sizeof(Attribute)
  679. typedef struct X942DhParameters {
  680. union {
  681. ASN1uint16_t bit_mask;
  682. ASN1octet_t o[1];
  683. };
  684. HUGEINTEGER p;
  685. HUGEINTEGER g;
  686. HUGEINTEGER q;
  687. # define j_present 0x80
  688. HUGEINTEGER j;
  689. # define validationParams_present 0x40
  690. X942DhValidationParams validationParams;
  691. } X942DhParameters;
  692. #define X942DhParameters_PDU 48
  693. #define SIZE_X509_Module_PDU_48 sizeof(X942DhParameters)
  694. typedef struct X942DhOtherInfo {
  695. union {
  696. ASN1uint16_t bit_mask;
  697. ASN1octet_t o[1];
  698. };
  699. X942DhKeySpecificInfo keyInfo;
  700. # define pubInfo_present 0x80
  701. OCTETSTRING pubInfo;
  702. OCTETSTRING keyLength;
  703. } X942DhOtherInfo;
  704. #define X942DhOtherInfo_PDU 49
  705. #define SIZE_X509_Module_PDU_49 sizeof(X942DhOtherInfo)
  706. typedef struct CertificateToBeSigned {
  707. union {
  708. ASN1uint16_t bit_mask;
  709. ASN1octet_t o[1];
  710. };
  711. # define CertificateToBeSigned_version_present 0x80
  712. CertificateVersion version;
  713. CertificateSerialNumber serialNumber;
  714. AlgorithmIdentifier signature;
  715. NOCOPYANY issuer;
  716. Validity validity;
  717. NOCOPYANY subject;
  718. SubjectPublicKeyInfo subjectPublicKeyInfo;
  719. # define issuerUniqueIdentifier_present 0x40
  720. UniqueIdentifier issuerUniqueIdentifier;
  721. # define subjectUniqueIdentifier_present 0x20
  722. UniqueIdentifier subjectUniqueIdentifier;
  723. # define extensions_present 0x10
  724. Extensions extensions;
  725. } CertificateToBeSigned;
  726. #define CertificateToBeSigned_PDU 50
  727. #define SIZE_X509_Module_PDU_50 sizeof(CertificateToBeSigned)
  728. typedef struct CertificateRevocationListToBeSigned {
  729. union {
  730. ASN1uint16_t bit_mask;
  731. ASN1octet_t o[1];
  732. };
  733. # define CertificateRevocationListToBeSigned_version_present 0x80
  734. CRLVersion version;
  735. AlgorithmIdentifier signature;
  736. NOCOPYANY issuer;
  737. ChoiceOfTime thisUpdate;
  738. # define nextUpdate_present 0x40
  739. ChoiceOfTime nextUpdate;
  740. # define revokedCertificates_present 0x20
  741. RevokedCertificates revokedCertificates;
  742. # define crlExtensions_present 0x10
  743. Extensions crlExtensions;
  744. } CertificateRevocationListToBeSigned;
  745. #define CertificateRevocationListToBeSigned_PDU 51
  746. #define SIZE_X509_Module_PDU_51 sizeof(CertificateRevocationListToBeSigned)
  747. typedef struct KeyAttributes {
  748. union {
  749. ASN1uint16_t bit_mask;
  750. ASN1octet_t o[1];
  751. };
  752. # define KeyAttributes_keyIdentifier_present 0x80
  753. KeyIdentifier keyIdentifier;
  754. # define intendedKeyUsage_present 0x40
  755. KeyUsage intendedKeyUsage;
  756. # define privateKeyUsagePeriod_present 0x20
  757. PrivateKeyValidity privateKeyUsagePeriod;
  758. } KeyAttributes;
  759. #define KeyAttributes_PDU 52
  760. #define SIZE_X509_Module_PDU_52 sizeof(KeyAttributes)
  761. typedef struct KeyUsageRestriction {
  762. union {
  763. ASN1uint16_t bit_mask;
  764. ASN1octet_t o[1];
  765. };
  766. # define certPolicySet_present 0x80
  767. CertPolicySet certPolicySet;
  768. # define restrictedKeyUsage_present 0x40
  769. KeyUsage restrictedKeyUsage;
  770. } KeyUsageRestriction;
  771. #define KeyUsageRestriction_PDU 53
  772. #define SIZE_X509_Module_PDU_53 sizeof(KeyUsageRestriction)
  773. typedef struct GeneralName {
  774. ASN1choice_t choice;
  775. union {
  776. # define otherName_chosen 1
  777. OtherName otherName;
  778. # define rfc822Name_chosen 2
  779. IA5STRING rfc822Name;
  780. # define dNSName_chosen 3
  781. IA5STRING dNSName;
  782. # define x400Address_chosen 4
  783. SeqOfAny x400Address;
  784. # define directoryName_chosen 5
  785. NOCOPYANY directoryName;
  786. # define ediPartyName_chosen 6
  787. SeqOfAny ediPartyName;
  788. # define uniformResourceLocator_chosen 7
  789. IA5STRING uniformResourceLocator;
  790. # define iPAddress_chosen 8
  791. OCTETSTRING iPAddress;
  792. # define registeredID_chosen 9
  793. EncodedObjectID registeredID;
  794. } u;
  795. } GeneralName;
  796. typedef struct BasicConstraints {
  797. union {
  798. ASN1uint16_t bit_mask;
  799. ASN1octet_t o[1];
  800. };
  801. SubjectType subjectType;
  802. # define BasicConstraints_pathLenConstraint_present 0x80
  803. ASN1int32_t pathLenConstraint;
  804. # define subtreesConstraint_present 0x40
  805. SubtreesConstraint subtreesConstraint;
  806. } BasicConstraints;
  807. #define BasicConstraints_PDU 54
  808. #define SIZE_X509_Module_PDU_54 sizeof(BasicConstraints)
  809. typedef struct PolicyInformation {
  810. union {
  811. ASN1uint16_t bit_mask;
  812. ASN1octet_t o[1];
  813. };
  814. EncodedObjectID policyIdentifier;
  815. # define policyQualifiers_present 0x80
  816. PolicyQualifiers policyQualifiers;
  817. } PolicyInformation;
  818. typedef struct UserNotice {
  819. union {
  820. ASN1uint16_t bit_mask;
  821. ASN1octet_t o[1];
  822. };
  823. # define noticeRef_present 0x80
  824. NoticeReference noticeRef;
  825. # define explicitText_present 0x40
  826. DisplayText explicitText;
  827. } UserNotice;
  828. #define UserNotice_PDU 55
  829. #define SIZE_X509_Module_PDU_55 sizeof(UserNotice)
  830. typedef struct VerisignQualifier1 {
  831. union {
  832. ASN1uint16_t bit_mask;
  833. ASN1octet_t o[1];
  834. };
  835. # define practicesReference_present 0x80
  836. ASN1ztcharstring_t practicesReference;
  837. # define noticeId_present 0x40
  838. EncodedObjectID noticeId;
  839. # define nsiNoticeId_present 0x20
  840. EncodedObjectID nsiNoticeId;
  841. # define cpsURLs_present 0x10
  842. CpsURLs cpsURLs;
  843. } VerisignQualifier1;
  844. #define VerisignQualifier1_PDU 56
  845. #define SIZE_X509_Module_PDU_56 sizeof(VerisignQualifier1)
  846. typedef struct AccessDescription {
  847. EncodedObjectID accessMethod;
  848. GeneralName accessLocation;
  849. } AccessDescription;
  850. typedef struct DistributionPoint {
  851. union {
  852. ASN1uint16_t bit_mask;
  853. ASN1octet_t o[1];
  854. };
  855. # define distributionPoint_present 0x80
  856. DistributionPointName distributionPoint;
  857. # define reasons_present 0x40
  858. ReasonFlags reasons;
  859. # define cRLIssuer_present 0x20
  860. GeneralNames cRLIssuer;
  861. } DistributionPoint;
  862. typedef struct ContentInfoSeqOfAny {
  863. union {
  864. ASN1uint16_t bit_mask;
  865. ASN1octet_t o[1];
  866. };
  867. ContentType contentType;
  868. # define contentSeqOfAny_present 0x80
  869. SeqOfAny contentSeqOfAny;
  870. } ContentInfoSeqOfAny;
  871. #define ContentInfoSeqOfAny_PDU 57
  872. #define SIZE_X509_Module_PDU_57 sizeof(ContentInfoSeqOfAny)
  873. typedef struct CertificateTrustList {
  874. union {
  875. ASN1uint16_t bit_mask;
  876. ASN1octet_t o[1];
  877. };
  878. # define CertificateTrustList_version_present 0x80
  879. CTLVersion version;
  880. SubjectUsage subjectUsage;
  881. # define listIdentifier_present 0x40
  882. ListIdentifier listIdentifier;
  883. # define sequenceNumber_present 0x20
  884. HUGEINTEGER sequenceNumber;
  885. ChoiceOfTime ctlThisUpdate;
  886. # define ctlNextUpdate_present 0x10
  887. ChoiceOfTime ctlNextUpdate;
  888. AlgorithmIdentifier subjectAlgorithm;
  889. # define trustedSubjects_present 0x8
  890. TrustedSubjects trustedSubjects;
  891. # define ctlExtensions_present 0x4
  892. Extensions ctlExtensions;
  893. } CertificateTrustList;
  894. #define CertificateTrustList_PDU 58
  895. #define SIZE_X509_Module_PDU_58 sizeof(CertificateTrustList)
  896. typedef struct NameConstraints {
  897. union {
  898. ASN1uint16_t bit_mask;
  899. ASN1octet_t o[1];
  900. };
  901. # define permittedSubtrees_present 0x80
  902. GeneralSubtrees permittedSubtrees;
  903. # define excludedSubtrees_present 0x40
  904. GeneralSubtrees excludedSubtrees;
  905. } NameConstraints;
  906. #define NameConstraints_PDU 59
  907. #define SIZE_X509_Module_PDU_59 sizeof(NameConstraints)
  908. typedef struct GeneralSubtree {
  909. union {
  910. ASN1uint16_t bit_mask;
  911. ASN1octet_t o[1];
  912. };
  913. GeneralName base;
  914. # define minimum_present 0x80
  915. BaseDistance minimum;
  916. # define maximum_present 0x40
  917. BaseDistance maximum;
  918. } GeneralSubtree;
  919. typedef struct CrossCertDistPoints {
  920. union {
  921. ASN1uint16_t bit_mask;
  922. ASN1octet_t o[1];
  923. };
  924. # define syncDeltaTime_present 0x80
  925. ASN1uint32_t syncDeltaTime;
  926. CrossCertDistPointNames crossCertDistPointNames;
  927. } CrossCertDistPoints;
  928. #define CrossCertDistPoints_PDU 60
  929. #define SIZE_X509_Module_PDU_60 sizeof(CrossCertDistPoints)
  930. typedef struct CmcData {
  931. ControlSequence controlSequence;
  932. ReqSequence reqSequence;
  933. CmsSequence cmsSequence;
  934. OtherMsgSequence otherMsgSequence;
  935. } CmcData;
  936. #define CmcData_PDU 61
  937. #define SIZE_X509_Module_PDU_61 sizeof(CmcData)
  938. typedef struct CmcResponseBody {
  939. ControlSequence controlSequence;
  940. CmsSequence cmsSequence;
  941. OtherMsgSequence otherMsgSequence;
  942. } CmcResponseBody;
  943. #define CmcResponseBody_PDU 62
  944. #define SIZE_X509_Module_PDU_62 sizeof(CmcResponseBody)
  945. typedef struct TaggedRequest {
  946. ASN1choice_t choice;
  947. union {
  948. # define tcr_chosen 1
  949. TaggedCertificationRequest tcr;
  950. } u;
  951. } TaggedRequest;
  952. typedef struct CmcStatusInfo {
  953. union {
  954. ASN1uint16_t bit_mask;
  955. ASN1octet_t o[1];
  956. };
  957. ASN1uint32_t cmcStatus;
  958. BodyPartIDSequence bodyList;
  959. # define statusString_present 0x80
  960. UTF8STRING statusString;
  961. # define otherInfo_present 0x40
  962. CmcStatusInfo_otherInfo otherInfo;
  963. } CmcStatusInfo;
  964. #define CmcStatusInfo_PDU 63
  965. #define SIZE_X509_Module_PDU_63 sizeof(CmcStatusInfo)
  966. extern ASN1bool_t IssuingDistributionPoint_indirectCRL_default;
  967. extern ASN1bool_t IssuingDistributionPoint_onlyContainsCACerts_default;
  968. extern ASN1bool_t IssuingDistributionPoint_onlyContainsUserCerts_default;
  969. extern BaseDistance GeneralSubtree_minimum_default;
  970. extern CTLVersion CertificateTrustList_version_default;
  971. extern ASN1bool_t BasicConstraints2_cA_default;
  972. extern ASN1bool_t Extension_critical_default;
  973. extern CertificateVersion CertificateToBeSigned_version_default;
  974. extern ASN1module_t X509_Module;
  975. extern void ASN1CALL X509_Module_Startup(void);
  976. extern void ASN1CALL X509_Module_Cleanup(void);
  977. /* Prototypes of element functions for SEQUENCE OF and SET OF constructs */
  978. #ifdef __cplusplus
  979. } /* extern "C" */
  980. #endif
  981. #endif /* _X509_Module_H_ */