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.

93 lines
2.8 KiB

  1. // MSRsaKB.h -- MicroSoft RSA Key Blob class header
  2. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  3. // 1999. This computer program includes Confidential, Proprietary
  4. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  5. // use, disclosure, and/or reproduction is prohibited unless authorized
  6. // in writing. All Rights Reserved.
  7. #if !defined(SLBCSP_MSRSAKB_H)
  8. #define SLBCSP_MSRSAKB_H
  9. #include <wincrypt.h>
  10. #include "RsaKey.h"
  11. #include "MsKeyBlob.h"
  12. class MsRsaKeyBlob
  13. : public MsKeyBlob,
  14. public RsaKey
  15. {
  16. public:
  17. // Types
  18. typedef DWORD PublicExponentType;
  19. typedef RSAPUBKEY HeaderElementType;
  20. struct ValueType
  21. {
  22. MsKeyBlob::ValueType keyblob;
  23. HeaderElementType rsapubkey;
  24. };
  25. typedef BYTE ElementValueType; // type of modulus elements
  26. // C'tors/D'tors
  27. // Operators
  28. // Operations
  29. // Access
  30. BitLengthType
  31. BitLength() const;
  32. ValueType const *
  33. Data() const;
  34. ModulusLengthType
  35. Length() const;
  36. PublicExponentType
  37. PublicExponent() const;
  38. // Predicates
  39. protected:
  40. // Types
  41. // C'tors/D'tors
  42. MsRsaKeyBlob(MsKeyBlob::KeyBlobType kbt,
  43. ALG_ID algid,
  44. StrengthType strength,
  45. Blob const &rbPublicExponent,
  46. SizeType cReserve);
  47. MsRsaKeyBlob(BYTE const *pbData,
  48. DWORD dwDataLength);
  49. virtual
  50. ~MsRsaKeyBlob();
  51. // Operators
  52. // Operations
  53. // Access
  54. // Predicates
  55. // Variables
  56. private:
  57. // Types
  58. enum MagicConstant
  59. {
  60. mcPublic = 0x31415352, // hex encoding of "RSA1"
  61. mcPrivate = 0x32415352 // hex encoding of "RSA2"
  62. };
  63. // C'tors/D'tors
  64. // Operators
  65. // Operations
  66. // Access
  67. // Predicates
  68. // Variables
  69. };
  70. #endif // SLBCSP_MSRSAKB_H