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.

130 lines
3.2 KiB

  1. /* Copyright (C) Microsoft Corporation, 1996-1999. All rights reserved. */
  2. /* ASN.1 definitions for SCHANNEL FORTEZZA and Private Key encoding */
  3. #ifndef _ASN1ENC_Module_H_
  4. #define _ASN1ENC_Module_H_
  5. #include "msber.h"
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. typedef ASN1open_t PrivateKeyInfo_attributes_Set;
  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 ASN1objectidentifier2_t ObjectID;
  27. typedef BITSTRING FORTPublicKey;
  28. #define FORTPublicKey_PDU 0
  29. #define SIZE_ASN1ENC_Module_PDU_0 sizeof(FORTPublicKey)
  30. typedef ASN1octetstring_t EncryptedData;
  31. typedef ObjectID UsageIdentifier;
  32. typedef struct PrivateKeyInfo_attributes {
  33. ASN1uint32_t count;
  34. PrivateKeyInfo_attributes_Set *value;
  35. } PrivateKeyInfo_attributes;
  36. typedef struct AlgorithmIdentifier {
  37. union {
  38. ASN1uint16_t bit_mask;
  39. ASN1octet_t o[1];
  40. };
  41. ObjectID algorithm;
  42. # define parameters_present 0x80
  43. ASN1open_t parameters;
  44. } AlgorithmIdentifier;
  45. typedef struct RSAPrivateKey {
  46. ASN1int32_t version;
  47. HUGEINTEGER modulus;
  48. ASN1int32_t publicExponent;
  49. HUGEINTEGER privateExponent;
  50. HUGEINTEGER prime1;
  51. HUGEINTEGER prime2;
  52. HUGEINTEGER exponent1;
  53. HUGEINTEGER exponent2;
  54. HUGEINTEGER coefficient;
  55. } RSAPrivateKey;
  56. #define RSAPrivateKey_PDU 1
  57. #define SIZE_ASN1ENC_Module_PDU_1 sizeof(RSAPrivateKey)
  58. typedef struct PrivateKeyInfo {
  59. union {
  60. ASN1uint16_t bit_mask;
  61. ASN1octet_t o[1];
  62. };
  63. ASN1int32_t version;
  64. AlgorithmIdentifier privateKeyAlgorithm;
  65. ASN1octetstring_t privateKey;
  66. # define attributes_present 0x80
  67. PrivateKeyInfo_attributes attributes;
  68. } PrivateKeyInfo;
  69. #define PrivateKeyInfo_PDU 2
  70. #define SIZE_ASN1ENC_Module_PDU_2 sizeof(PrivateKeyInfo)
  71. typedef struct PrivateKeyData {
  72. AlgorithmIdentifier privateKeyAlgorithm;
  73. EncryptedData privateKey;
  74. } PrivateKeyData;
  75. typedef struct PrivateKeyFile {
  76. ASN1octetstring_t name;
  77. PrivateKeyData privateKey;
  78. } PrivateKeyFile;
  79. #define PrivateKeyFile_PDU 3
  80. #define SIZE_ASN1ENC_Module_PDU_3 sizeof(PrivateKeyFile)
  81. typedef struct EnhancedKeyUsage {
  82. ASN1uint32_t count;
  83. UsageIdentifier *value;
  84. } EnhancedKeyUsage;
  85. #define EnhancedKeyUsage_PDU 4
  86. #define SIZE_ASN1ENC_Module_PDU_4 sizeof(EnhancedKeyUsage)
  87. extern ASN1module_t ASN1ENC_Module;
  88. extern void ASN1CALL ASN1ENC_Module_Startup(void);
  89. extern void ASN1CALL ASN1ENC_Module_Cleanup(void);
  90. /* Prototypes of element functions for SEQUENCE OF and SET OF constructs */
  91. #ifdef __cplusplus
  92. } /* extern "C" */
  93. #endif
  94. #endif /* _ASN1ENC_Module_H_ */