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.

120 lines
3.6 KiB

  1. // AKeyPair.h: interface for the CAbstractKeyPair 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_AKEYPAIR_H)
  12. #define SLBCCI_AKEYPAIR_H
  13. #include <string>
  14. #include <slbRCObj.h>
  15. #include "slbCci.h"
  16. #include "cciCard.h"
  17. #include "CryptObj.h"
  18. #include "KPCont.h"
  19. namespace cci
  20. {
  21. class CCertificate;
  22. class CPrivateKey;
  23. class CPublicKey;
  24. class CAbstractKeyPair
  25. : public slbRefCnt::RCObject,
  26. public CCryptObject
  27. {
  28. public:
  29. // Types
  30. // C'tors/D'tors
  31. virtual
  32. ~CAbstractKeyPair() throw() = 0;
  33. // Operators
  34. bool
  35. operator==(CAbstractKeyPair const &rhs) const;
  36. // TO DO: this should be superceded by implementing singletons
  37. bool
  38. operator!=(CAbstractKeyPair const &rhs) const;
  39. // TO DO: this should be superceded by implementing singletons
  40. // Operations
  41. virtual void
  42. Certificate(CCertificate const &rcert) = 0;
  43. virtual void
  44. PrivateKey(CPrivateKey const &rprikey) = 0;
  45. virtual void
  46. PublicKey(CPublicKey const &rpubkey) = 0;
  47. // Access
  48. virtual CCertificate
  49. Certificate() const = 0;
  50. CContainer
  51. Container() const;
  52. KeySpec
  53. Spec() const;
  54. virtual CPrivateKey
  55. PrivateKey() const = 0;
  56. virtual CPublicKey
  57. PublicKey() const = 0;
  58. // Predicates
  59. protected:
  60. // Types
  61. // C'tors/D'tors
  62. CAbstractKeyPair(CAbstractCard const &racard,
  63. CContainer const &rhcont,
  64. KeySpec ks);
  65. // Operators
  66. // Operations
  67. // Access
  68. // Predicates
  69. virtual bool
  70. DoEquals(CAbstractKeyPair const &rhs) const = 0;
  71. // TO DO: this should be superceded by implementing singletons
  72. // Variables
  73. KeySpec const m_ks;
  74. CContainer const m_hcont;
  75. private:
  76. // Types
  77. // C'tors/D'tors
  78. CAbstractKeyPair(CAbstractKeyPair const &rhs);
  79. // not defined, copying not allowed.
  80. // Operators
  81. CAbstractKeyPair &
  82. operator=(CAbstractKeyPair const &rhs);
  83. // not defined, initialization not allowed.
  84. // Operations
  85. // Access
  86. // Predicates
  87. // Variables
  88. };
  89. } // namespace
  90. #endif // !defined(SLBCCI_AKEYPAIR_H)