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.

106 lines
3.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows NT Security
  4. // Copyright (C) Microsoft Corporation, 1997 - 1999
  5. //
  6. // File: scrdcert.h
  7. //
  8. // Contents: Smart Card Certificate Helper API
  9. //
  10. // History: 21-Nov-97 kirtd Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #if !defined(__SCRDCERT_H__)
  14. #define __SCRDCERT_H__
  15. #if defined(__cplusplus)
  16. extern "C" {
  17. #endif
  18. //
  19. // Register and Unregister a smart card certificate store. These stores
  20. // appear as physical stores under the Smart Card Logical Store in the
  21. // Current User location. When registering a card store, the caller must
  22. // provide the following information:
  23. //
  24. // Card Friendly Name
  25. // Provider Name ( NULL means use the Microsoft Base Smart Card Provider )
  26. // Container Name ( NULL means use the Card Friendly Name )
  27. //
  28. // If a card store of the given name already exists the registration will
  29. // return an error (ERROR_ALREADY_EXISTS) unless the
  30. // SMART_CARD_STORE_REPLACE_EXISTING flag is used
  31. //
  32. #define SMART_CARD_STORE_REPLACE_EXISTING 0x00000001
  33. BOOL WINAPI
  34. I_CryptRegisterSmartCardStore (
  35. IN LPCWSTR pwszCardName,
  36. IN OPTIONAL LPCWSTR pwszProvider,
  37. IN OPTIONAL DWORD dwProviderType,
  38. IN OPTIONAL LPCWSTR pwszContainer,
  39. IN DWORD dwFlags
  40. );
  41. BOOL WINAPI
  42. I_CryptUnregisterSmartCardStore (
  43. IN LPCWSTR pwszCardName
  44. );
  45. //
  46. // Find a smart card certificate in a store
  47. //
  48. // For a certificate to be considered a smart card certificate. It must have
  49. // the CERT_SMART_CARD_DATA_PROP_ID. The SMART_CARD_CERT_FIND_DATA can be used
  50. // to place additional filtering on the returned smart card certificates.
  51. // Optionally, the CERT_SMART_CARD_DATA_PROP_ID value can be returned as well.
  52. // The value can be freed using LocalFree or if the *ppSmartCardData is non NULL
  53. // will be freed for the caller
  54. //
  55. typedef struct _SMART_CARD_CERT_FIND_DATA {
  56. DWORD cbSize;
  57. LPWSTR pwszProvider;
  58. DWORD dwProviderType;
  59. LPWSTR pwszContainer;
  60. DWORD dwKeySpec;
  61. } SMART_CARD_CERT_FIND_DATA, *PSMART_CARD_CERT_FIND_DATA;
  62. PCCERT_CONTEXT WINAPI
  63. I_CryptFindSmartCardCertInStore (
  64. IN HCERTSTORE hStore,
  65. IN PCCERT_CONTEXT pPrevCert,
  66. IN OPTIONAL PSMART_CARD_CERT_FIND_DATA pFindData,
  67. IN OUT OPTIONAL PCRYPT_DATA_BLOB* ppSmartCardData
  68. );
  69. //
  70. // Add a smart card certificate to a store and add the specified properties
  71. // to it.
  72. //
  73. BOOL WINAPI
  74. I_CryptAddSmartCardCertToStore (
  75. IN HCERTSTORE hStore,
  76. IN PCRYPT_DATA_BLOB pEncodedCert,
  77. IN OPTIONAL LPWSTR pwszCertFriendlyName,
  78. IN PCRYPT_DATA_BLOB pSmartCardData,
  79. IN PCRYPT_KEY_PROV_INFO pKeyProvInfo
  80. );
  81. //
  82. // Definitions
  83. //
  84. #define MS_BASE_PROVIDER L"Microsoft Base Cryptographic Provider"
  85. #define MAX_PROVIDER_TYPE_STRLEN 13
  86. #define SMART_CARD_SYSTEM_STORE L"SmartCard"
  87. #if defined(__cplusplus)
  88. }
  89. #endif
  90. #endif