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.

90 lines
3.1 KiB

  1. // APublicKey.cpp -- CAbstractPublicKey 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 <algorithm>
  8. #include "cciPubKey.h"
  9. #include "cciCont.h"
  10. #include "AKeyPair.h"
  11. #include "TransactionWrap.h"
  12. #include "AContHelp.h"
  13. using namespace std;
  14. using namespace cci;
  15. /////////////////////////// LOCAL/HELPER /////////////////////////////////
  16. /////////////////////////// PUBLIC /////////////////////////////////
  17. // Types
  18. // C'tors/D'tors
  19. CAbstractPublicKey::~CAbstractPublicKey()
  20. {}
  21. // Operators
  22. bool
  23. CAbstractPublicKey::operator==(CAbstractPublicKey const &rhs) const
  24. {
  25. CTransactionWrap wrap(m_hcard);
  26. CTransactionWrap rhswrap(rhs.m_hcard);
  27. return CProtectableCrypt::operator==(rhs) &&
  28. DoEquals(rhs);
  29. }
  30. bool
  31. CAbstractPublicKey::operator!=(CAbstractPublicKey const &rhs) const
  32. {
  33. return !(*this == rhs);
  34. }
  35. // Operations
  36. void
  37. CAbstractPublicKey::Delete()
  38. {
  39. CTransactionWrap wrap(m_hcard);
  40. // Remove any references to this object from the container
  41. vector<CContainer> vCont(m_hcard->EnumContainers());
  42. for_each(vCont.begin(), vCont.end(),
  43. EraseFromContainer<CPublicKey, CAbstractKeyPair>(CPublicKey(this),
  44. CAbstractKeyPair::PublicKey,
  45. CAbstractKeyPair::PublicKey));
  46. DoDelete();
  47. }
  48. // Access
  49. // Predicates
  50. // Static Variables
  51. /////////////////////////// PROTECTED /////////////////////////////////
  52. // C'tors/D'tors
  53. CAbstractPublicKey::CAbstractPublicKey(CAbstractCard const &racard,
  54. ObjectAccess oa)
  55. : slbRefCnt::RCObject(),
  56. CProtectableCrypt(racard, oa)
  57. {}
  58. // Operators
  59. // Operations
  60. // Access
  61. // Predicates
  62. // Static Variables
  63. /////////////////////////// PRIVATE /////////////////////////////////
  64. // C'tors/D'tors
  65. // Operators
  66. // Operations
  67. // Access
  68. // Predicates
  69. // Static Variables