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.

130 lines
2.9 KiB

  1. /* Copyright (C) Microsoft Corporation, 1996 - 1999 All rights reserved. */
  2. /* ASN.1 definitions for X509 v3 certificates */
  3. #ifndef _PRVTKEY_Module_H_
  4. #define _PRVTKEY_Module_H_
  5. #include "msber.h"
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. typedef ASN1intx_t HUGEINTEGER;
  10. typedef ASN1bitstring_t BITSTRING;
  11. typedef ASN1octetstring_t OCTETSTRING;
  12. typedef ASN1open_t NOCOPYANY;
  13. typedef ASN1charstring_t NUMERICSTRING;
  14. typedef ASN1charstring_t PRINTABLESTRING;
  15. typedef ASN1charstring_t TELETEXSTRING;
  16. typedef ASN1charstring_t T61STRING;
  17. typedef ASN1charstring_t VIDEOTEXSTRING;
  18. typedef ASN1charstring_t IA5STRING;
  19. typedef ASN1charstring_t GRAPHICSTRING;
  20. typedef ASN1charstring_t VISIBLESTRING;
  21. typedef ASN1charstring_t ISO646STRING;
  22. typedef ASN1charstring_t GENERALSTRING;
  23. typedef ASN1char32string_t UNIVERSALSTRING;
  24. typedef ASN1char16string_t BMPSTRING;
  25. typedef ASN1objectidentifier2_t ObjectID;
  26. typedef ASN1int32_t Version;
  27. typedef OCTETSTRING PrivateKey;
  28. typedef OCTETSTRING EncryptedData;
  29. typedef struct AlgorithmIdentifier {
  30. union {
  31. ASN1uint16_t bit_mask;
  32. ASN1octet_t o[1];
  33. };
  34. ObjectID algorithm;
  35. # define parameters_present 0x80
  36. NOCOPYANY parameters;
  37. } AlgorithmIdentifier;
  38. typedef struct AttributeSetValue {
  39. ASN1uint32_t count;
  40. NOCOPYANY *value;
  41. } AttributeSetValue;
  42. typedef struct Attributes {
  43. ASN1uint32_t count;
  44. struct Attribute *value;
  45. } Attributes;
  46. typedef struct RSAPrivateKey {
  47. Version version;
  48. HUGEINTEGER modulus;
  49. ASN1int32_t publicExponent;
  50. HUGEINTEGER privateExponent;
  51. HUGEINTEGER prime1;
  52. HUGEINTEGER prime2;
  53. HUGEINTEGER exponent1;
  54. HUGEINTEGER exponent2;
  55. HUGEINTEGER coefficient;
  56. } RSAPrivateKey;
  57. #define RSAPrivateKey_PDU 0
  58. #define SIZE_PRVTKEY_Module_PDU_0 sizeof(RSAPrivateKey)
  59. typedef AlgorithmIdentifier PrivateKeyAlgorithmIdentifier;
  60. typedef struct PrivateKeyInfo {
  61. union {
  62. ASN1uint16_t bit_mask;
  63. ASN1octet_t o[1];
  64. };
  65. Version version;
  66. PrivateKeyAlgorithmIdentifier privateKeyAlgorithm;
  67. PrivateKey privateKey;
  68. # define privateKeyAttributes_present 0x80
  69. Attributes privateKeyAttributes;
  70. } PrivateKeyInfo;
  71. #define PrivateKeyInfo_PDU 1
  72. #define SIZE_PRVTKEY_Module_PDU_1 sizeof(PrivateKeyInfo)
  73. typedef AlgorithmIdentifier EncryptionAlgorithmIdentifier;
  74. typedef struct EncryptedPrivateKeyInfo {
  75. EncryptionAlgorithmIdentifier encryptionAlgorithm;
  76. EncryptedData encryptedData;
  77. } EncryptedPrivateKeyInfo;
  78. #define EncryptedPrivateKeyInfo_PDU 2
  79. #define SIZE_PRVTKEY_Module_PDU_2 sizeof(EncryptedPrivateKeyInfo)
  80. typedef struct Attribute {
  81. ObjectID type;
  82. AttributeSetValue values;
  83. } Attribute;
  84. #define Attribute_PDU 3
  85. #define SIZE_PRVTKEY_Module_PDU_3 sizeof(Attribute)
  86. extern ASN1module_t PRVTKEY_Module;
  87. extern void ASN1CALL PRVTKEY_Module_Startup(void);
  88. extern void ASN1CALL PRVTKEY_Module_Cleanup(void);
  89. /* Prototypes of element functions for SEQUENCE OF and SET OF constructs */
  90. #ifdef __cplusplus
  91. } /* extern "C" */
  92. #endif
  93. #endif /* _PRVTKEY_Module_H_ */