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.

105 lines
2.3 KiB

  1. // SLBCCI.H
  2. //
  3. // This file contains all of the macro definitions and other defines
  4. // used within the common crypto interface layer.
  5. //
  6. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  7. // 1999. This computer program includes Confidential, Proprietary
  8. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  9. // use, disclosure, and/or reproduction is prohibited unless authorized
  10. // in writing. All Rights Reserved.
  11. /////////////////////////////////////////////////////////////////////////////////
  12. #ifndef SLBCCI_H
  13. #define SLBCCI_H
  14. #include "cciExc.h"
  15. #include "SmartCard.h"
  16. // OS dependent definitions and includes
  17. #if defined(_WIN32)
  18. // Export flags, so that the same headers can be used by client and server
  19. #ifdef CCI_IN_DLL
  20. #define CCI_INTERFACE __declspec(dllexport)
  21. #define EXP_IMP_TEMPLATE
  22. #else
  23. #define CCI_INTERFACE __declspec(dllimport)
  24. #define EXP_IMP_TEMPLATE extern
  25. #endif
  26. #include <windows.h>
  27. #elif defined(_OS_UNIX)
  28. typedef DWORD unsigned long
  29. typedef BYTE unsigned char
  30. #elif defined(_OS_MAC)
  31. #else
  32. #error OS_NOT_DEFINED
  33. #endif
  34. namespace cci {
  35. typedef struct CCI_Date
  36. {
  37. BYTE bDay;
  38. BYTE bMonth;
  39. DWORD dwYear; // I'm not Y4Gig compliant....
  40. } Date;
  41. typedef struct CCI_Format
  42. {
  43. BYTE bMajor;
  44. BYTE bMinor;
  45. } Format;
  46. enum ObjectAccess { oaNoAccess, oaPublicAccess, oaPrivateAccess};
  47. enum ShareMode { smShared, smExclusive};
  48. enum ObjectType { otContainerObject, otCertificateObject, otPublicKeyObject,
  49. otPrivateKeyObject, otDataObjectObject};
  50. typedef iop::KeyType KeyType;
  51. using iop::ktRSA512;
  52. using iop::ktRSA768;
  53. using iop::ktRSA1024;
  54. typedef iop::CardOperation CardOperation;
  55. using iop::coEncryption;
  56. using iop::coDecryption;
  57. using iop::coKeyGeneration;
  58. enum SCardType { UnknownCard, Cryptoflex8K, Access16K };
  59. enum KeySpec { ksExchange = 0, ksSignature = 1, ksNone = -1 };
  60. void DateStructToDateArray(cci::Date *dStruct, BYTE *bArray);
  61. void DateArrayToDateStruct(BYTE *bArray, cci::Date *dStruct);
  62. void SetBit(BYTE *Buf, unsigned int Bit);
  63. void ResetBit(BYTE *Buf, unsigned int Bit);
  64. bool BitSet(BYTE *Buf, unsigned int Bit);
  65. } // namespace cci
  66. // Includes
  67. #include "slbarch.h"
  68. #endif