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.

114 lines
4.1 KiB

  1. // AccessCard.h: interface for the CAccessCard class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(ACCESSCARD_H__INCLUDED_)
  5. #define ACCESSCARD_H__INCLUDED_
  6. #include "DllSymDefn.h"
  7. #include "SmartCard.h"
  8. namespace iop
  9. {
  10. class IOPDLL_API CAccessCard : public CSmartCard
  11. {
  12. public:
  13. CAccessCard(const SCARDHANDLE hCardHandle, const char* szReaderName,
  14. const SCARDCONTEXT pContext, const DWORD dwMode);
  15. virtual ~CAccessCard();
  16. virtual void DeleteFile(const WORD wFileID);
  17. virtual void CreateFile(const FILE_HEADER* pMyFile);
  18. virtual void SelectParent();
  19. virtual void Directory (const BYTE bFile_Nb, FILE_HEADER* pMyFile);
  20. virtual void Select (const char* szFileFullPath, FILE_HEADER* pMyFile=NULL, const bool fSelectAll = false);
  21. virtual void SelectCardlet(const BYTE *bAID, const BYTE bAIDLen);
  22. virtual void SelectLoader();
  23. virtual void GetSerial(BYTE* bSerial, size_t &SerialLength);
  24. virtual void DeleteApplet();
  25. virtual void ResetInstance();
  26. virtual void SetCurrentAsLoader();
  27. virtual void SetDefaultAsLoader();
  28. virtual void BlockApplet();
  29. virtual void ValidateProgram(const BYTE *bSig, const BYTE bSigLength);
  30. virtual void ResetProgram();
  31. virtual void ExecuteMain();
  32. virtual void ExecuteInstall(const BYTE *bBlock, const BYTE bLen);
  33. virtual void ReadRecord(const BYTE bRecNum, const BYTE bMode, const BYTE bDataLen, BYTE *bData);
  34. virtual void UpdateRecord(const BYTE bRecNum, const BYTE bMode, const BYTE bDataLen, BYTE *bData);
  35. virtual void VerifyKey (const BYTE bKeyNumber, const BYTE bKeyLength, const BYTE* bKey);
  36. virtual void VerifyCHV (const BYTE bCHVNumber, const BYTE* bCHV);
  37. virtual void VerifyTransportKey(const BYTE *bKey);
  38. virtual void LogoutAll();
  39. virtual void GetChallenge(const DWORD dwNumberLength, BYTE* bRandomNumber);
  40. virtual void ExternalAuth(const KeyType kt, const BYTE bKeyNb,
  41. const BYTE bDataLength, const BYTE* bData);
  42. virtual void InternalAuth(const KeyType kt, const BYTE bKeyNb,
  43. const BYTE bDataLength, const BYTE* bDataIn, BYTE* bDataOut);
  44. virtual void ReadPublicKey (CPublicKeyBlob *aKey, const BYTE bKeyNum);
  45. virtual void WritePublicKey (const CPublicKeyBlob aKey, const BYTE bKeyNum);
  46. virtual void WritePrivateKey(const CPrivateKeyBlob aKey, const BYTE bKeyNum);
  47. virtual void ChangeACL (const BYTE *bACL);
  48. virtual void ChangeCHV (const BYTE bKeyNumber, const BYTE *bOldCHV, const BYTE *bNewCHV);
  49. virtual void ChangeCHV (const BYTE bKey_nb, const BYTE *bNewCHV);
  50. virtual void UnblockCHV (const BYTE bKeyNumber, const BYTE *bUnblockPIN, const BYTE *bNewPin);
  51. virtual void ChangeUnblockKey (const BYTE bKeyNumber, const BYTE *bNewPIN);
  52. virtual void ChangeTransportKey(const BYTE *bNewKey);
  53. protected:
  54. virtual void
  55. DefaultDispatchError(ClassByte cb,
  56. Instruction ins,
  57. WORD StatusWord) const;
  58. virtual void
  59. DispatchError(ClassByte cb,
  60. Instruction ins,
  61. WORD StatusWord) const;
  62. virtual void
  63. DoReadBlock(WORD wOffset,
  64. BYTE *pbBuffer,
  65. BYTE bLength);
  66. virtual void
  67. DoWriteBlock(WORD wOffset,
  68. BYTE const *pbBuffer,
  69. BYTE cLength);
  70. virtual bool
  71. SupportLogout();
  72. virtual void Select(const WORD wFileID);
  73. BYTE m_bClassByte;
  74. private:
  75. enum // size_t/count
  76. {
  77. cMaxDirInfo = 0x28,
  78. };
  79. enum // Instruction
  80. {
  81. insDeleteFile = 0xE4,
  82. insDirectory = 0xA8,
  83. insExecuteMethod = 0x0C,
  84. insExternalAuth = 0x82,
  85. insGetACL = 0xFE,
  86. };
  87. bool
  88. ValidClassByte(BYTE bClassByte);
  89. };
  90. }
  91. #endif // !defined(AFX_ACCESSCARD_H__INCLUDED_)