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
3.0 KiB

  1. // AKeyPair.cpp -- CAbstractKeyPair implementation
  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. #include "cciKeyPair.h"
  8. #include "cciCont.h"
  9. #include "TransactionWrap.h"
  10. using namespace std;
  11. using namespace cci;
  12. /////////////////////////// LOCAL/HELPER /////////////////////////////////
  13. /////////////////////////// PUBLIC /////////////////////////////////
  14. // Types
  15. // C'tors/D'tors
  16. CAbstractKeyPair::~CAbstractKeyPair()
  17. {}
  18. // Operators
  19. bool
  20. CAbstractKeyPair::operator==(CAbstractKeyPair const &rhs) const
  21. {
  22. CTransactionWrap wrap(m_hcard);
  23. CTransactionWrap rhswrap(rhs.m_hcard);
  24. return CCryptObject::operator==(rhs) &&
  25. (m_hcont == rhs.m_hcont) &&
  26. (m_ks == rhs.m_ks) &&
  27. DoEquals(rhs);
  28. }
  29. bool
  30. CAbstractKeyPair::operator!=(CAbstractKeyPair const &rhs) const
  31. {
  32. return !(*this == rhs);
  33. }
  34. // Operations
  35. // Access
  36. CContainer
  37. CAbstractKeyPair::Container() const
  38. {
  39. return m_hcont;
  40. }
  41. KeySpec
  42. CAbstractKeyPair::Spec() const
  43. {
  44. return m_ks;
  45. }
  46. // Predicates
  47. // Static Variables
  48. /////////////////////////// PROTECTED /////////////////////////////////
  49. // C'tors/D'tors
  50. CAbstractKeyPair::CAbstractKeyPair(CAbstractCard const &racard,
  51. CContainer const &rhcont,
  52. KeySpec ks)
  53. : slbRefCnt::RCObject(),
  54. CCryptObject(racard),
  55. m_hcont(rhcont),
  56. m_ks(ks)
  57. {
  58. if (ksNone == m_ks)
  59. throw Exception(ccBadKeySpec);
  60. }
  61. // Operators
  62. // Operations
  63. // Access
  64. // Predicates
  65. // Static Variables
  66. /////////////////////////// PRIVATE /////////////////////////////////
  67. // C'tors/D'tors
  68. // Operators
  69. // Operations
  70. // Access
  71. // Predicates
  72. // Static Variables