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.

229 lines
4.8 KiB

  1. // V1PriKey.h: interface for the CV1PrivateKey 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_V1PRIKEY_H)
  12. #define SLBCCI_V1PRIKEY_H
  13. #include <string>
  14. #include <vector>
  15. #include <memory> // for auto_ptr
  16. #include <slbRCObj.h>
  17. #include "slbCci.h" // for KeySpec
  18. #include "APriKey.h"
  19. namespace cci
  20. {
  21. class CV1Card;
  22. class CPriKeyInfoRecord;
  23. class CV1PrivateKey
  24. : public CAbstractPrivateKey
  25. {
  26. public:
  27. // Types
  28. // C'tors/D'tors
  29. CV1PrivateKey(CV1Card const &rv1card,
  30. KeySpec ks);
  31. virtual
  32. ~CV1PrivateKey() throw();
  33. // Operators
  34. // Operations
  35. void
  36. AssociateWith(KeySpec ks);
  37. virtual void
  38. CredentialID(std::string const &rstrID);
  39. virtual void
  40. Decrypt(bool flag);
  41. virtual void
  42. Derive(bool flag);
  43. virtual void
  44. EndDate(Date const &rEndDate);
  45. virtual void
  46. Exportable(bool flag);
  47. virtual void
  48. ID(std::string const &rstrID);
  49. virtual std::string
  50. InternalAuth(std::string const &rstrOld);
  51. virtual void
  52. Label(std::string const &rstrLabel);
  53. virtual void
  54. Local(bool flag);
  55. static CV1PrivateKey *
  56. Make(CV1Card const &rv1card,
  57. KeySpec ks);
  58. virtual void
  59. Modifiable(bool flag);
  60. virtual void
  61. Modulus(std::string const &rstrModulus);
  62. virtual void
  63. NeverExportable(bool flag);
  64. virtual void
  65. NeverRead(bool flag);
  66. virtual void
  67. PublicExponent(std::string const &rstrExponent);
  68. virtual void
  69. Read(bool flag);
  70. virtual void
  71. Sign(bool flag);
  72. virtual void
  73. SignRecover(bool flag);
  74. virtual void
  75. StartDate(Date &rdtStart);
  76. virtual void
  77. Subject(std::string const &rstrSubject);
  78. virtual void
  79. Unwrap(bool flag);
  80. // Access
  81. virtual std::string
  82. CredentialID();
  83. virtual bool
  84. Decrypt();
  85. virtual bool
  86. Derive();
  87. virtual Date
  88. EndDate();
  89. virtual bool
  90. Exportable();
  91. virtual std::string
  92. ID();
  93. virtual std::string
  94. Label();
  95. virtual bool
  96. Local();
  97. virtual bool
  98. Modifiable();
  99. virtual std::string
  100. Modulus();
  101. virtual bool
  102. NeverExportable();
  103. virtual bool
  104. NeverRead();
  105. virtual bool
  106. Private();
  107. virtual std::string
  108. PublicExponent();
  109. virtual bool
  110. Read();
  111. virtual bool
  112. Sign();
  113. virtual bool
  114. SignRecover();
  115. virtual Date
  116. StartDate();
  117. virtual std::string
  118. Subject();
  119. virtual bool
  120. Unwrap();
  121. // Predicates
  122. protected:
  123. // Types
  124. // C'tors/D'tors
  125. // Operators
  126. // Operations
  127. virtual void
  128. DoDelete();
  129. virtual void
  130. DoWriteKey(CPrivateKeyBlob const &rblob);
  131. // Access
  132. // Predicates
  133. virtual bool
  134. DoEquals(CAbstractPrivateKey const &rhs) const;
  135. // Variables
  136. private:
  137. // Types
  138. // C'tors/D'tors
  139. CV1PrivateKey(CAbstractPrivateKey const &rhs);
  140. // not defined, copying not allowed.
  141. // Operators
  142. CAbstractPrivateKey &
  143. operator=(CAbstractPrivateKey const &rhs);
  144. // not defined, initialization not allowed.
  145. // Operations
  146. void
  147. Store();
  148. // Access
  149. // Predicates
  150. // Variables
  151. KeySpec m_ks;
  152. std::auto_ptr<CPrivateKeyBlob> m_apKeyBlob;
  153. };
  154. } // namespace
  155. #endif // !defined(SLBCCI_V1