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.

220 lines
5.3 KiB

  1. /* Copyright (C) Microsoft Corporation, 1996-1999. All rights reserved. */
  2. /* ASN.1 definitions for X509 v3 certificates */
  3. #ifndef _XMSASN_Module_H_
  4. #define _XMSASN_Module_H_
  5. #include "msber.h"
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. typedef ASN1bitstring_t BITSTRING;
  10. typedef ASN1char16string_t BMPSTRING;
  11. typedef ASN1objectidentifier2_t ObjectID;
  12. typedef ObjectID UsageIdentifier;
  13. typedef ASN1wstring_t UTF8STRING;
  14. typedef ASN1octetstring_t OCTETSTRING;
  15. typedef ASN1open_t NOCOPYANY;
  16. typedef ASN1uint32_t BodyPartID;
  17. typedef struct EnhancedKeyUsage {
  18. ASN1uint32_t count;
  19. UsageIdentifier *value;
  20. } EnhancedKeyUsage;
  21. #define EnhancedKeyUsage_PDU 0
  22. #define SIZE_XMSASN_Module_PDU_0 sizeof(EnhancedKeyUsage)
  23. typedef struct RequestFlags {
  24. ASN1bool_t fWriteToCSP;
  25. ASN1bool_t fWriteToDS;
  26. ASN1int32_t openFlags;
  27. } RequestFlags;
  28. #define RequestFlags_PDU 1
  29. #define SIZE_XMSASN_Module_PDU_1 sizeof(RequestFlags)
  30. typedef struct CSPProvider {
  31. ASN1int32_t keySpec;
  32. BMPSTRING cspName;
  33. BITSTRING signature;
  34. } CSPProvider;
  35. #define CSPProvider_PDU 2
  36. #define SIZE_XMSASN_Module_PDU_2 sizeof(CSPProvider)
  37. typedef struct EnrollmentNameValuePair {
  38. BMPSTRING name;
  39. BMPSTRING value;
  40. } EnrollmentNameValuePair;
  41. #define EnrollmentNameValuePair_PDU 3
  42. #define SIZE_XMSASN_Module_PDU_3 sizeof(EnrollmentNameValuePair)
  43. typedef struct Extensions {
  44. ASN1uint32_t count;
  45. struct Extension *value;
  46. } Extensions;
  47. typedef struct Extension {
  48. union {
  49. ASN1uint16_t bit_mask;
  50. ASN1octet_t o[1];
  51. };
  52. ObjectID extnId;
  53. # define critical_present 0x80
  54. ASN1bool_t critical;
  55. OCTETSTRING extnValue;
  56. } Extension;
  57. typedef struct AttributeSetValue {
  58. ASN1uint32_t count;
  59. NOCOPYANY *value;
  60. } AttributeSetValue;
  61. typedef struct Attributes {
  62. ASN1uint32_t count;
  63. struct Attribute *value;
  64. } Attributes;
  65. typedef struct ControlSequence {
  66. ASN1uint32_t count;
  67. struct TaggedAttribute *value;
  68. } ControlSequence;
  69. typedef struct ReqSequence {
  70. ASN1uint32_t count;
  71. struct TaggedRequest *value;
  72. } ReqSequence;
  73. typedef struct CmsSequence {
  74. ASN1uint32_t count;
  75. struct TaggedContentInfo *value;
  76. } CmsSequence;
  77. typedef struct OtherMsgSequence {
  78. ASN1uint32_t count;
  79. struct TaggedOtherMsg *value;
  80. } OtherMsgSequence;
  81. typedef struct BodyPartIDSequence {
  82. ASN1uint32_t count;
  83. BodyPartID *value;
  84. } BodyPartIDSequence;
  85. typedef struct TaggedAttribute {
  86. BodyPartID bodyPartID;
  87. ObjectID type;
  88. AttributeSetValue values;
  89. } TaggedAttribute;
  90. typedef struct TaggedCertificationRequest {
  91. BodyPartID bodyPartID;
  92. NOCOPYANY certificationRequest;
  93. } TaggedCertificationRequest;
  94. typedef struct TaggedContentInfo {
  95. BodyPartID bodyPartID;
  96. NOCOPYANY contentInfo;
  97. } TaggedContentInfo;
  98. typedef struct TaggedOtherMsg {
  99. BodyPartID bodyPartID;
  100. ObjectID otherMsgType;
  101. NOCOPYANY otherMsgValue;
  102. } TaggedOtherMsg;
  103. typedef struct PendInfo {
  104. OCTETSTRING pendToken;
  105. ASN1generalizedtime_t pendTime;
  106. } PendInfo;
  107. typedef struct CmcAddExtensions {
  108. BodyPartID pkiDataReference;
  109. BodyPartIDSequence certReferences;
  110. Extensions extensions;
  111. } CmcAddExtensions;
  112. #define CmcAddExtensions_PDU 4
  113. #define SIZE_XMSASN_Module_PDU_4 sizeof(CmcAddExtensions)
  114. typedef struct CmcAddAttributes {
  115. BodyPartID pkiDataReference;
  116. BodyPartIDSequence certReferences;
  117. Attributes attributes;
  118. } CmcAddAttributes;
  119. #define CmcAddAttributes_PDU 5
  120. #define SIZE_XMSASN_Module_PDU_5 sizeof(CmcAddAttributes)
  121. typedef struct CmcStatusInfo_otherInfo {
  122. ASN1choice_t choice;
  123. union {
  124. # define failInfo_chosen 1
  125. ASN1uint32_t failInfo;
  126. # define pendInfo_chosen 2
  127. PendInfo pendInfo;
  128. } u;
  129. } CmcStatusInfo_otherInfo;
  130. typedef struct Attribute {
  131. ObjectID type;
  132. AttributeSetValue values;
  133. } Attribute;
  134. typedef struct CmcData {
  135. ControlSequence controlSequence;
  136. ReqSequence reqSequence;
  137. CmsSequence cmsSequence;
  138. OtherMsgSequence otherMsgSequence;
  139. } CmcData;
  140. #define CmcData_PDU 6
  141. #define SIZE_XMSASN_Module_PDU_6 sizeof(CmcData)
  142. typedef struct CmcResponseBody {
  143. ControlSequence controlSequence;
  144. CmsSequence cmsSequence;
  145. OtherMsgSequence otherMsgSequence;
  146. } CmcResponseBody;
  147. #define CmcResponseBody_PDU 7
  148. #define SIZE_XMSASN_Module_PDU_7 sizeof(CmcResponseBody)
  149. typedef struct TaggedRequest {
  150. ASN1choice_t choice;
  151. union {
  152. # define tcr_chosen 1
  153. TaggedCertificationRequest tcr;
  154. } u;
  155. } TaggedRequest;
  156. typedef struct CmcStatusInfo {
  157. union {
  158. ASN1uint16_t bit_mask;
  159. ASN1octet_t o[1];
  160. };
  161. ASN1uint32_t cmcStatus;
  162. BodyPartIDSequence bodyList;
  163. # define statusString_present 0x80
  164. UTF8STRING statusString;
  165. # define otherInfo_present 0x40
  166. CmcStatusInfo_otherInfo otherInfo;
  167. } CmcStatusInfo;
  168. #define CmcStatusInfo_PDU 8
  169. #define SIZE_XMSASN_Module_PDU_8 sizeof(CmcStatusInfo)
  170. extern ASN1bool_t Extension_critical_default;
  171. extern ASN1module_t XMSASN_Module;
  172. extern void ASN1CALL XMSASN_Module_Startup(void);
  173. extern void ASN1CALL XMSASN_Module_Cleanup(void);
  174. /* Prototypes of element functions for SEQUENCE OF and SET OF constructs */
  175. #ifdef __cplusplus
  176. } /* extern "C" */
  177. #endif
  178. #endif /* _XMSASN_Module_H_ */