Source code of Windows XP (NT5)
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.

266 lines
6.5 KiB

  1. /* Copyright (C) Microsoft Corporation, 1996 - 1999 All rights reserved. */
  2. /* ASN.1 definitions for PFXPKCS */
  3. #ifndef _PFXPKCS_Module_H_
  4. #define _PFXPKCS_Module_H_
  5. #include "msber.h"
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. typedef ASN1open_t AttributeSetValue_Set;
  10. typedef ASN1objectidentifier2_t ObjectID;
  11. typedef ObjectID ObjID;
  12. typedef ASN1open_t Any;
  13. typedef ObjectID ObjectIdentifierType;
  14. #define ObjectIdentifierType_PDU 0
  15. #define SIZE_PFXPKCS_Module_PDU_0 sizeof(ObjectIdentifierType)
  16. typedef ASN1octetstring_t OctetStringType;
  17. #define OctetStringType_PDU 1
  18. #define SIZE_PFXPKCS_Module_PDU_1 sizeof(OctetStringType)
  19. typedef ASN1intx_t IntegerType;
  20. #define IntegerType_PDU 2
  21. #define SIZE_PFXPKCS_Module_PDU_2 sizeof(IntegerType)
  22. typedef ASN1intx_t HugeInteger;
  23. typedef ASN1int32_t Version;
  24. typedef ASN1octetstring_t PrivateKey;
  25. typedef ASN1octetstring_t EncryptedContent;
  26. typedef ASN1octetstring_t Digest;
  27. typedef ObjectID ContentType;
  28. typedef ASN1octetstring_t X509Cert;
  29. typedef ASN1ztcharstring_t SDSICert;
  30. typedef ASN1octetstring_t X509CRL;
  31. typedef struct RSAPublicKey {
  32. HugeInteger modulus;
  33. HugeInteger publicExponent;
  34. } RSAPublicKey;
  35. #define RSAPublicKey_PDU 3
  36. #define SIZE_PFXPKCS_Module_PDU_3 sizeof(RSAPublicKey)
  37. typedef struct RSAPrivateKey {
  38. Version version;
  39. HugeInteger modulus;
  40. ASN1int32_t publicExponent;
  41. HugeInteger privateExponent;
  42. HugeInteger prime1;
  43. HugeInteger prime2;
  44. HugeInteger exponent1;
  45. HugeInteger exponent2;
  46. HugeInteger coefficient;
  47. } RSAPrivateKey;
  48. #define RSAPrivateKey_PDU 4
  49. #define SIZE_PFXPKCS_Module_PDU_4 sizeof(RSAPrivateKey)
  50. typedef struct AlgorithmIdentifier {
  51. union {
  52. ASN1uint16_t bit_mask;
  53. ASN1octet_t o[1];
  54. };
  55. ObjectID algorithm;
  56. # define parameters_present 0x80
  57. ASN1open_t parameters;
  58. } AlgorithmIdentifier;
  59. typedef struct PBEParameter {
  60. ASN1octetstring_t salt;
  61. ASN1int32_t iterationCount;
  62. } PBEParameter;
  63. #define PBEParameter_PDU 5
  64. #define SIZE_PFXPKCS_Module_PDU_5 sizeof(PBEParameter)
  65. typedef AlgorithmIdentifier DigestAlgorithmIdentifier;
  66. typedef struct AttributeSetValue {
  67. ASN1uint32_t count;
  68. AttributeSetValue_Set *value;
  69. } AttributeSetValue;
  70. #define AttributeSetValue_PDU 6
  71. #define SIZE_PFXPKCS_Module_PDU_6 sizeof(AttributeSetValue)
  72. typedef struct Attribute {
  73. ObjectID attributeType;
  74. AttributeSetValue attributeValue;
  75. } Attribute;
  76. typedef struct Attributes {
  77. ASN1uint32_t count;
  78. struct Attribute *value;
  79. } Attributes;
  80. #define Attributes_PDU 7
  81. #define SIZE_PFXPKCS_Module_PDU_7 sizeof(Attributes)
  82. typedef struct ContentInfo {
  83. union {
  84. ASN1uint16_t bit_mask;
  85. ASN1octet_t o[1];
  86. };
  87. ContentType contentType;
  88. # define content_present 0x80
  89. ASN1open_t content;
  90. } ContentInfo;
  91. typedef struct AuthenticatedSafes {
  92. ASN1uint32_t count;
  93. struct ContentInfo *value;
  94. } AuthenticatedSafes;
  95. #define AuthenticatedSafes_PDU 8
  96. #define SIZE_PFXPKCS_Module_PDU_8 sizeof(AuthenticatedSafes)
  97. typedef struct SafeContents {
  98. ASN1uint32_t count;
  99. struct SafeBag *value;
  100. } SafeContents;
  101. #define SafeContents_PDU 9
  102. #define SIZE_PFXPKCS_Module_PDU_9 sizeof(SafeContents)
  103. typedef struct SafeBag {
  104. union {
  105. ASN1uint16_t bit_mask;
  106. ASN1octet_t o[1];
  107. };
  108. ObjectID safeBagType;
  109. ASN1open_t safeBagContent;
  110. # define safeBagAttribs_present 0x80
  111. Attributes safeBagAttribs;
  112. } SafeBag;
  113. #define SafeBag_PDU 10
  114. #define SIZE_PFXPKCS_Module_PDU_10 sizeof(SafeBag)
  115. typedef struct CertBag {
  116. ObjectID certType;
  117. ASN1open_t value;
  118. } CertBag;
  119. #define CertBag_PDU 11
  120. #define SIZE_PFXPKCS_Module_PDU_11 sizeof(CertBag)
  121. typedef struct CRLBag {
  122. ObjectID crlType;
  123. ASN1open_t value;
  124. } CRLBag;
  125. #define CRLBag_PDU 12
  126. #define SIZE_PFXPKCS_Module_PDU_12 sizeof(CRLBag)
  127. typedef struct SecretBag {
  128. ObjectID secretType;
  129. ASN1open_t secretContent;
  130. } SecretBag;
  131. #define SecretBag_PDU 13
  132. #define SIZE_PFXPKCS_Module_PDU_13 sizeof(SecretBag)
  133. typedef AlgorithmIdentifier PrivateKeyAlgorithmIdentifier;
  134. typedef AlgorithmIdentifier EncryptionAlgorithmIdentifier;
  135. typedef AlgorithmIdentifier ContentEncryptionAlgorithmIdentifier;
  136. typedef struct DigestInfo {
  137. DigestAlgorithmIdentifier digestAlgorithm;
  138. Digest digest;
  139. } DigestInfo;
  140. #define DigestInfo_PDU 14
  141. #define SIZE_PFXPKCS_Module_PDU_14 sizeof(DigestInfo)
  142. typedef struct MacData {
  143. union {
  144. ASN1uint16_t bit_mask;
  145. ASN1octet_t o[1];
  146. };
  147. DigestInfo safeMac;
  148. ASN1octetstring_t macSalt;
  149. # define macIterationCount_present 0x80
  150. ASN1int32_t macIterationCount;
  151. } MacData;
  152. #define MacData_PDU 15
  153. #define SIZE_PFXPKCS_Module_PDU_15 sizeof(MacData)
  154. typedef struct PrivateKeyInfo {
  155. union {
  156. ASN1uint16_t bit_mask;
  157. ASN1octet_t o[1];
  158. };
  159. Version version;
  160. PrivateKeyAlgorithmIdentifier privateKeyAlgorithm;
  161. PrivateKey privateKey;
  162. # define attributes_present 0x80
  163. Attributes attributes;
  164. } PrivateKeyInfo;
  165. #define PrivateKeyInfo_PDU 16
  166. #define SIZE_PFXPKCS_Module_PDU_16 sizeof(PrivateKeyInfo)
  167. typedef struct EncryptedContentInfo {
  168. union {
  169. ASN1uint16_t bit_mask;
  170. ASN1octet_t o[1];
  171. };
  172. ContentType contentType;
  173. ContentEncryptionAlgorithmIdentifier contentEncryptionAlg;
  174. # define encryptedContent_present 0x80
  175. EncryptedContent encryptedContent;
  176. } EncryptedContentInfo;
  177. typedef struct PFX {
  178. union {
  179. ASN1uint16_t bit_mask;
  180. ASN1octet_t o[1];
  181. };
  182. Version version;
  183. ContentInfo authSafes;
  184. # define macData_present 0x80
  185. MacData macData;
  186. } PFX;
  187. #define PFX_PDU 17
  188. #define SIZE_PFXPKCS_Module_PDU_17 sizeof(PFX)
  189. typedef PrivateKeyInfo KeyBag;
  190. #define KeyBag_PDU 18
  191. #define SIZE_PFXPKCS_Module_PDU_18 sizeof(KeyBag)
  192. typedef struct EncryptedData {
  193. Version version;
  194. EncryptedContentInfo encryptedContentInfo;
  195. } EncryptedData;
  196. #define EncryptedData_PDU 19
  197. #define SIZE_PFXPKCS_Module_PDU_19 sizeof(EncryptedData)
  198. typedef struct EncryptedPrivateKeyInfo {
  199. EncryptionAlgorithmIdentifier encryptionAlgorithm;
  200. EncryptedData encryptedData;
  201. } EncryptedPrivateKeyInfo;
  202. #define EncryptedPrivateKeyInfo_PDU 20
  203. #define SIZE_PFXPKCS_Module_PDU_20 sizeof(EncryptedPrivateKeyInfo)
  204. typedef EncryptedPrivateKeyInfo Pkcs_8ShroudedKeyBag;
  205. #define Pkcs_8ShroudedKeyBag_PDU 21
  206. #define SIZE_PFXPKCS_Module_PDU_21 sizeof(Pkcs_8ShroudedKeyBag)
  207. extern ASN1int32_t MacData_macIterationCount_default;
  208. extern ASN1module_t PFXPKCS_Module;
  209. extern void ASN1CALL PFXPKCS_Module_Startup(void);
  210. extern void ASN1CALL PFXPKCS_Module_Cleanup(void);
  211. /* Prototypes of element functions for SEQUENCE OF and SET OF constructs */
  212. #ifdef __cplusplus
  213. } /* extern "C" */
  214. #endif
  215. #endif /* _PFXPKCS_Module_H_ */