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.

108 lines
2.8 KiB

  1. // AccessTok.h -- Card Access Token class declaration.
  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. #if !defined(SLBCSP_ACCESSTOK_H)
  8. #define SLBCSP_ACCESSTOK_H
  9. #include <string>
  10. #include <pincache.h>
  11. #include "HCardCtx.h"
  12. #include "LoginId.h"
  13. #include "ExceptionContext.h"
  14. // Describes a security context of a card consisting of the identity and
  15. // password.
  16. class AccessToken
  17. : protected ExceptionContext
  18. {
  19. public:
  20. // Types
  21. enum
  22. {
  23. MaxPinLength = 8
  24. };
  25. // C'tors/D'tors
  26. AccessToken(HCardContext const &rhcardctx,
  27. LoginIdentity const &rlid);
  28. AccessToken(AccessToken const &rhs);
  29. ~AccessToken();
  30. // Operators
  31. // Operations
  32. void
  33. Authenticate();
  34. void
  35. ChangePin(AccessToken const &ratNew);
  36. void
  37. ClearPin();
  38. void
  39. FlushPin();
  40. void
  41. Pin(std::string const &rsPin,
  42. bool fInHex = false);
  43. // Access
  44. HCardContext
  45. CardContext() const;
  46. LoginIdentity
  47. Identity() const;
  48. std::string
  49. Pin() const;
  50. // Predicates
  51. bool
  52. PinIsCached() const;
  53. protected:
  54. // Types
  55. // C'tors/D'tors
  56. // Operators
  57. // Operations
  58. // Access
  59. // Predicates
  60. // Variables
  61. private:
  62. // Types
  63. // C'tors/D'tors
  64. // Operators
  65. // Operations
  66. static DWORD
  67. ChangeCardPin(PPINCACHE_PINS pPins,
  68. PVOID pvCallbackCtx);
  69. static DWORD
  70. VerifyPin(PPINCACHE_PINS pPins,
  71. PVOID pvCallbackCtx);
  72. // Access
  73. // Predicates
  74. // Variables
  75. HCardContext const m_hcardctx;
  76. LoginIdentity const m_lid;
  77. PINCACHE_HANDLE m_hpc;
  78. std::string m_sPin;
  79. };
  80. #endif // SLBCSP_ACCESSTOK_H