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.

84 lines
2.7 KiB

  1. // ObjectInfoFile.h: interface for the CObjectInfoFile 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. #if !defined(CCI_OBJECTINFOFILE_H)
  10. #define CCI_OBJECTINFOFILE_H
  11. #include "slbCci.h"
  12. namespace cci {
  13. class CObjectInfoFile
  14. {
  15. public:
  16. CObjectInfoFile(iop::CSmartCard &rSmartCard,
  17. std::string const &rPath,
  18. ObjectAccess oa);
  19. virtual ~CObjectInfoFile() {};
  20. void Reset();
  21. void UpdateCache();
  22. ObjectAccess
  23. AccessType() const;
  24. CSymbolTable &SymbolTable() {return m_SymbolTable; };
  25. SymbolID AddSymbol(std::string aString);
  26. std::string FindSymbol(SymbolID sid);
  27. void RemoveSymbol(SymbolID sid);
  28. SymbolID DefaultContainer() const { return m_bDefaultContainer; };
  29. void DefaultContainer(SymbolID bHandle);
  30. SymbolID FirstObject(ObjectType type) const;
  31. void FirstObject(ObjectType type, SymbolID bHandle);
  32. SymbolID NextObject(SymbolID bHandle);
  33. void NextObject(SymbolID bHandle, SymbolID bHandleNext);
  34. SymbolID AddObject(ObjectType type, unsigned short size);
  35. void RemoveObject(ObjectType type, SymbolID bHandle);
  36. void ReadObject(SymbolID bHandle, BYTE* bData);
  37. void WriteObject(SymbolID bHandle, BYTE* bData);
  38. unsigned short TableSize();
  39. unsigned short FreeSpace();
  40. private:
  41. ObjectAccess m_oa;
  42. std::string m_Path;
  43. CSymbolTable m_SymbolTable;
  44. iop::CSmartCard &m_rSmartCard;
  45. SymbolID m_bDefaultContainer;
  46. SymbolID m_bFirstContainer;
  47. SymbolID m_bFirstCertificate;
  48. SymbolID m_bFirstPublicKey;
  49. SymbolID m_bFirstPrivateKey;
  50. SymbolID m_bFirstDataObject;
  51. };
  52. const unsigned short ObjDefaultContainerLoc = 0; // Location of default container handle
  53. const unsigned short ObjFirstContainerLoc = 1; // Location of first container handle
  54. const unsigned short ObjFirstCertificateLoc = 2; // Location of first certificate handle
  55. const unsigned short ObjFirstPublicKeyLoc = 3; // Location of first public key handle
  56. const unsigned short ObjFirstPrivateKeyLoc = 4; // Location of first private key handle
  57. const unsigned short ObjFirstDataObjectLoc = 5; // Location of first data object handle
  58. const unsigned short ObjMasterBlkSize = 10; // Size of master block
  59. }
  60. #endif // !defined(CCI_OBJECTINFOFILE_H)