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.

239 lines
5.2 KiB

  1. // V2PriKey.h: interface for the CV2PrivateKey class.
  2. //
  3. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  4. // 1999. This computer program includes Confidential, Proprietary
  5. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  6. // use, disclosure, and/or reproduction is prohibited unless authorized
  7. // in writing. All Rights Reserved.
  8. //////////////////////////////////////////////////////////////////////
  9. // Note: This file should only be included by the CCI, not directly
  10. // by the client.
  11. #if !defined(SLBCCI_V2PRIKEY_H)
  12. #define SLBCCI_V2PRIKEY_H
  13. #include <string>
  14. #include <vector>
  15. #include <memory> // for auto_ptr
  16. #include <slbRCObj.h>
  17. #include "APriKey.h"
  18. namespace cci
  19. {
  20. class CV2Card;
  21. class CPriKeyInfoRecord;
  22. class CV2PrivateKey
  23. : public CAbstractPrivateKey
  24. {
  25. public:
  26. // Types
  27. // C'tors/D'tors
  28. CV2PrivateKey(CV2Card const &rv2card,
  29. ObjectAccess oa);
  30. CV2PrivateKey(CV2Card const &rv2card,
  31. SymbolID sidHandle,
  32. ObjectAccess oa);
  33. CV2PrivateKey(CV2Card const &rv2card,
  34. BYTE bKeyType,
  35. BYTE bKeyNumber,
  36. ObjectAccess oa);
  37. virtual
  38. ~CV2PrivateKey() throw();
  39. // Operators
  40. // Operations
  41. virtual void
  42. CredentialID(std::string const &rstrID);
  43. virtual void
  44. Decrypt(bool flag);
  45. virtual void
  46. Derive(bool flag);
  47. virtual void
  48. EndDate(Date const &rEndDate);
  49. virtual void
  50. Exportable(bool flag);
  51. virtual void
  52. ID(std::string const &rstrID);
  53. virtual std::string
  54. InternalAuth(std::string const &rstrOld);
  55. virtual void
  56. Label(std::string const &rstrLabel);
  57. virtual void
  58. Local(bool flag);
  59. static CV2PrivateKey *
  60. Make(CV2Card const &rv2card,
  61. SymbolID sidHandle,
  62. ObjectAccess oa);
  63. virtual void
  64. Modifiable(bool flag);
  65. virtual void
  66. Modulus(std::string const &rstrModulus);
  67. virtual void
  68. NeverExportable(bool flag);
  69. virtual void
  70. NeverRead(bool flag);
  71. virtual void
  72. PublicExponent(std::string const &rstrExponent);
  73. virtual void
  74. Read(bool flag);
  75. virtual void
  76. Sign(bool flag);
  77. virtual void
  78. SignRecover(bool flag);
  79. virtual void
  80. StartDate(Date &rdtStart);
  81. virtual void
  82. Subject(std::string const &rstrSubject);
  83. virtual void
  84. Unwrap(bool flag);
  85. // Access
  86. virtual std::string
  87. CredentialID();
  88. virtual bool
  89. Decrypt();
  90. virtual bool
  91. Derive();
  92. virtual Date
  93. EndDate();
  94. virtual bool
  95. Exportable();
  96. SymbolID
  97. Handle() const;
  98. virtual std::string
  99. ID();
  100. virtual std::string
  101. Label();
  102. virtual bool
  103. Local();
  104. virtual bool
  105. Modifiable();
  106. virtual std::string
  107. Modulus();
  108. virtual bool
  109. NeverExportable();
  110. virtual bool
  111. NeverRead();
  112. virtual bool
  113. Private();
  114. virtual std::string
  115. PublicExponent();
  116. virtual bool
  117. Read();
  118. virtual bool
  119. Sign();
  120. virtual bool
  121. SignRecover();
  122. virtual Date
  123. StartDate();
  124. virtual std::string
  125. Subject();
  126. virtual bool
  127. Unwrap();
  128. // Predicates
  129. protected:
  130. // Types
  131. // C'tors/D'tors
  132. // Operators
  133. // Operations
  134. virtual void
  135. DoDelete();
  136. virtual void
  137. DoWriteKey(CPrivateKeyBlob const &rblob);
  138. // Access
  139. // Predicates
  140. virtual bool
  141. DoEquals(CAbstractPrivateKey const &rhs) const;
  142. // Variables
  143. private:
  144. // Types
  145. // C'tors/D'tors
  146. CV2PrivateKey(CAbstractPrivateKey const &rhs);
  147. // not defined, copying not allowed.
  148. // Operators
  149. CAbstractPrivateKey &
  150. operator=(CAbstractPrivateKey const &rhs);
  151. // not defined, initialization not allowed.
  152. // Operations
  153. void
  154. Setup(CV2Card const &rv2card);
  155. void
  156. Setup(CV2Card const &rv2card,
  157. SymbolID sidHandle);
  158. // Access
  159. // Predicates
  160. // Variables
  161. SymbolID m_sidHandle;
  162. std::auto_ptr<CPriKeyInfoRecord> m_apcir;
  163. };
  164. } // namespace
  165. #endif // !defined(SLBCCI_V2PRIKEY_H)