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.

215 lines
4.9 KiB

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