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.

317 lines
8.0 KiB

  1. /* Copyright (C) Microsoft Corporation, 1996-1999. All rights reserved. */
  2. /* ASN.1 definitions for PFXNSCP */
  3. #ifndef _PFXNSCP_Module_H_
  4. #define _PFXNSCP_Module_H_
  5. #include "msber.h"
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. typedef ASN1objectidentifier2_t ObjectID;
  10. typedef ASN1objectidentifier2_t ObjID;
  11. typedef ASN1int32_t Version;
  12. #define Version_v1 1
  13. typedef ObjectID ContentType;
  14. typedef ASN1octetstring_t RSAData;
  15. #define RSAData_PDU 0
  16. #define SIZE_PFXNSCP_Module_PDU_0 sizeof(RSAData)
  17. typedef ASN1open_t Attribute;
  18. typedef ASN1octetstring_t EncryptedContent;
  19. typedef ASN1octetstring_t Digest;
  20. typedef ObjID TransportMode;
  21. typedef struct BaggageItem_unencryptedSecrets {
  22. ASN1uint32_t count;
  23. struct SafeBag *value;
  24. } BaggageItem_unencryptedSecrets;
  25. typedef struct BaggageItem_espvks {
  26. ASN1uint32_t count;
  27. struct ESPVK *value;
  28. } BaggageItem_espvks;
  29. typedef struct ContentInfo {
  30. union {
  31. ASN1uint16_t bit_mask;
  32. ASN1octet_t o[1];
  33. };
  34. ContentType contentType;
  35. # define content_present 0x80
  36. ASN1open_t content;
  37. } ContentInfo;
  38. typedef struct Attributes {
  39. ASN1uint32_t count;
  40. Attribute *value;
  41. } Attributes;
  42. #define Attributes_PDU 1
  43. #define SIZE_PFXNSCP_Module_PDU_1 sizeof(Attributes)
  44. typedef struct AlgorithmIdentifier {
  45. union {
  46. ASN1uint16_t bit_mask;
  47. ASN1octet_t o[1];
  48. };
  49. ObjectID algorithm;
  50. # define parameters_present 0x80
  51. ASN1open_t parameters;
  52. } AlgorithmIdentifier;
  53. typedef struct PBEParameter {
  54. ASN1octetstring_t salt;
  55. ASN1int32_t iterationCount;
  56. } PBEParameter;
  57. #define PBEParameter_PDU 2
  58. #define SIZE_PFXNSCP_Module_PDU_2 sizeof(PBEParameter)
  59. typedef AlgorithmIdentifier DigestAlgorithmIdentifier;
  60. typedef struct Baggage {
  61. ASN1uint32_t count;
  62. struct BaggageItem *value;
  63. } Baggage;
  64. typedef struct BaggageItem {
  65. BaggageItem_espvks espvks;
  66. BaggageItem_unencryptedSecrets unencryptedSecrets;
  67. } BaggageItem;
  68. typedef struct PvkAdditional {
  69. ObjID pvkAdditionalType;
  70. ASN1open_t pvkAdditionalContent;
  71. } PvkAdditional;
  72. #define PvkAdditional_PDU 3
  73. #define SIZE_PFXNSCP_Module_PDU_3 sizeof(PvkAdditional)
  74. typedef struct SafeContents {
  75. ASN1uint32_t count;
  76. struct SafeBag *value;
  77. } SafeContents;
  78. #define SafeContents_PDU 4
  79. #define SIZE_PFXNSCP_Module_PDU_4 sizeof(SafeContents)
  80. typedef struct SafeBag {
  81. union {
  82. ASN1uint16_t bit_mask;
  83. ASN1octet_t o[1];
  84. };
  85. ObjID safeBagType;
  86. ASN1open_t safeBagContent;
  87. # define safeBagName_present 0x80
  88. ASN1char16string_t safeBagName;
  89. } SafeBag;
  90. #define SafeBag_PDU 5
  91. #define SIZE_PFXNSCP_Module_PDU_5 sizeof(SafeBag)
  92. typedef struct KeyBag {
  93. ASN1uint32_t count;
  94. struct PrivateKey *value;
  95. } KeyBag;
  96. #define KeyBag_PDU 6
  97. #define SIZE_PFXNSCP_Module_PDU_6 sizeof(KeyBag)
  98. typedef struct CertCRLBag {
  99. ASN1uint32_t count;
  100. struct CertCRL *value;
  101. } CertCRLBag;
  102. #define CertCRLBag_PDU 7
  103. #define SIZE_PFXNSCP_Module_PDU_7 sizeof(CertCRLBag)
  104. typedef struct CertCRL {
  105. ObjID bagId;
  106. ASN1open_t value;
  107. } CertCRL;
  108. #define CertCRL_PDU 8
  109. #define SIZE_PFXNSCP_Module_PDU_8 sizeof(CertCRL)
  110. typedef struct X509Bag {
  111. ContentInfo certOrCRL;
  112. } X509Bag;
  113. #define X509Bag_PDU 9
  114. #define SIZE_PFXNSCP_Module_PDU_9 sizeof(X509Bag)
  115. typedef struct SDSICertBag {
  116. ASN1ztcharstring_t value;
  117. } SDSICertBag;
  118. #define SDSICertBag_PDU 10
  119. #define SIZE_PFXNSCP_Module_PDU_10 sizeof(SDSICertBag)
  120. typedef struct SecretBag {
  121. ASN1uint32_t count;
  122. struct Secret *value;
  123. } SecretBag;
  124. #define SecretBag_PDU 11
  125. #define SIZE_PFXNSCP_Module_PDU_11 sizeof(SecretBag)
  126. typedef struct SecretAdditional {
  127. ObjID secretAdditionalType;
  128. ASN1open_t secretAdditionalContent;
  129. } SecretAdditional;
  130. #define SecretAdditional_PDU 12
  131. #define SIZE_PFXNSCP_Module_PDU_12 sizeof(SecretAdditional)
  132. typedef AlgorithmIdentifier PrivateKeyAlgorithmIdentifier;
  133. typedef AlgorithmIdentifier EncryptionAlgorithmIdentifier;
  134. typedef AlgorithmIdentifier ContentEncryptionAlgorithmIdentifier;
  135. typedef struct DigestInfo {
  136. DigestAlgorithmIdentifier digestAlgorithm;
  137. Digest digest;
  138. } DigestInfo;
  139. typedef struct MacData {
  140. DigestInfo safeMAC;
  141. ASN1bitstring_t macSalt;
  142. } MacData;
  143. typedef struct AuthenticatedSafe {
  144. union {
  145. ASN1uint16_t bit_mask;
  146. ASN1octet_t o[1];
  147. };
  148. # define version_present 0x80
  149. Version version;
  150. # define transportMode_present 0x40
  151. TransportMode transportMode;
  152. # define privacySalt_present 0x20
  153. ASN1bitstring_t privacySalt;
  154. # define baggage_present 0x10
  155. Baggage baggage;
  156. ContentInfo safe;
  157. } AuthenticatedSafe;
  158. #define AuthenticatedSafe_PDU 13
  159. #define SIZE_PFXNSCP_Module_PDU_13 sizeof(AuthenticatedSafe)
  160. typedef DigestInfo Thumbprint;
  161. typedef struct Secret {
  162. union {
  163. ASN1uint16_t bit_mask;
  164. ASN1octet_t o[1];
  165. };
  166. ASN1char16string_t secretName;
  167. ObjID secretType;
  168. ASN1open_t value;
  169. # define secretAdditional_present 0x80
  170. SecretAdditional secretAdditional;
  171. } Secret;
  172. #define Secret_PDU 14
  173. #define SIZE_PFXNSCP_Module_PDU_14 sizeof(Secret)
  174. typedef struct PVKSupportingData_assocCerts {
  175. ASN1uint32_t count;
  176. Thumbprint *value;
  177. } PVKSupportingData_assocCerts;
  178. typedef struct PrivateKeyInfo {
  179. union {
  180. ASN1uint16_t bit_mask;
  181. ASN1octet_t o[1];
  182. };
  183. Version version;
  184. PrivateKeyAlgorithmIdentifier privateKeyAlgorithm;
  185. ASN1octetstring_t privateKey;
  186. # define attributes_present 0x80
  187. Attributes attributes;
  188. } PrivateKeyInfo;
  189. #define PrivateKeyInfo_PDU 15
  190. #define SIZE_PFXNSCP_Module_PDU_15 sizeof(PrivateKeyInfo)
  191. typedef struct EncryptedContentInfo {
  192. union {
  193. ASN1uint16_t bit_mask;
  194. ASN1octet_t o[1];
  195. };
  196. ContentType contentType;
  197. ContentEncryptionAlgorithmIdentifier contentEncryptionAlg;
  198. # define encryptedContent_present 0x80
  199. EncryptedContent encryptedContent;
  200. } EncryptedContentInfo;
  201. typedef struct PFX {
  202. union {
  203. ASN1uint16_t bit_mask;
  204. ASN1octet_t o[1];
  205. };
  206. # define macData_present 0x80
  207. MacData macData;
  208. ContentInfo authSafe;
  209. } PFX;
  210. #define PFX_PDU 16
  211. #define SIZE_PFXNSCP_Module_PDU_16 sizeof(PFX)
  212. typedef struct PVKSupportingData {
  213. union {
  214. ASN1uint16_t bit_mask;
  215. ASN1octet_t o[1];
  216. };
  217. PVKSupportingData_assocCerts assocCerts;
  218. # define regenerable_present 0x80
  219. ASN1bool_t regenerable;
  220. ASN1char16string_t nickname;
  221. # define pvkAdditional_present 0x40
  222. PvkAdditional pvkAdditional;
  223. } PVKSupportingData;
  224. #define PVKSupportingData_PDU 17
  225. #define SIZE_PFXNSCP_Module_PDU_17 sizeof(PVKSupportingData)
  226. typedef struct PrivateKey {
  227. PVKSupportingData pvkData;
  228. PrivateKeyInfo pkcs8data;
  229. } PrivateKey;
  230. #define PrivateKey_PDU 18
  231. #define SIZE_PFXNSCP_Module_PDU_18 sizeof(PrivateKey)
  232. typedef struct EncryptedData {
  233. Version version;
  234. EncryptedContentInfo encryptedContentInfo;
  235. } EncryptedData;
  236. #define EncryptedData_PDU 19
  237. #define SIZE_PFXNSCP_Module_PDU_19 sizeof(EncryptedData)
  238. typedef struct ESPVK {
  239. ObjID espvkObjID;
  240. PVKSupportingData espvkData;
  241. ASN1open_t espvkCipherText;
  242. } ESPVK;
  243. #define ESPVK_PDU 20
  244. #define SIZE_PFXNSCP_Module_PDU_20 sizeof(ESPVK)
  245. typedef struct EncryptedPrivateKeyInfo {
  246. EncryptionAlgorithmIdentifier encryptionAlgorithm;
  247. EncryptedData encryptedData;
  248. } EncryptedPrivateKeyInfo;
  249. #define EncryptedPrivateKeyInfo_PDU 21
  250. #define SIZE_PFXNSCP_Module_PDU_21 sizeof(EncryptedPrivateKeyInfo)
  251. extern ASN1bool_t PVKSupportingData_regenerable_default;
  252. extern Version AuthenticatedSafe_version_default;
  253. extern ASN1objectidentifier2_t rsa1;
  254. extern ASN1objectidentifier2_t pkcs_12;
  255. extern ASN1objectidentifier2_t pkcs_12ModeIds;
  256. extern ASN1objectidentifier2_t off_lineTransportMode;
  257. extern ASN1module_t PFXNSCP_Module;
  258. extern void ASN1CALL PFXNSCP_Module_Startup(void);
  259. extern void ASN1CALL PFXNSCP_Module_Cleanup(void);
  260. /* Prototypes of element functions for SEQUENCE OF and SET OF constructs */
  261. #ifdef __cplusplus
  262. } /* extern "C" */
  263. #endif
  264. #endif /* _PFXNSCP_Module_H_ */