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.

138 lines
4.4 KiB

  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Microsoft Windows, Copyright (C) Microsoft Corporation, 2000 - 2001.
  3. File: SignHlpr.h
  4. Content: Declaration of the signing helper functions.
  5. History: 09-07-2001 dsie created
  6. ------------------------------------------------------------------------------*/
  7. #ifndef __SIGNHLPR_H_
  8. #define __SIGNHLPR_H_
  9. ////////////////////
  10. //
  11. // typedefs
  12. //
  13. typedef struct
  14. {
  15. DWORD dwChoice; // 0 or 1
  16. union
  17. {
  18. LPWSTR pwszStoreName; // Store name, i.e. "My" if dwChoice = 0
  19. HCERTSTORE hCertStore; // Cert store handle, if dwChoice = 1
  20. };
  21. } CAPICOM_STORE_INFO, * PCAPICOM_STORE_INFO;
  22. // Values for dwChoice.
  23. #define CAPICOM_STORE_INFO_STORENAME 0
  24. #define CAPICOM_STORE_INFO_HCERTSTORE 1
  25. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  26. Function : FreeAttributes
  27. Synopsis : Free memory allocated for attributes.
  28. Parameter: DWORD cAttr - Number fo attributes
  29. PCRYPT_ATTRIBUTE rgAuthAttr - Pointer to CRYPT_ATTRIBUTE array.
  30. Remark :
  31. ------------------------------------------------------------------------------*/
  32. void FreeAttributes (DWORD cAttr,
  33. PCRYPT_ATTRIBUTE rgAttr);
  34. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  35. Function : FreeAttributes
  36. Synopsis : Free memory allocated for all attributes.
  37. Parameter: PCRYPT_ATTRIBUTES pAttributes
  38. Remark :
  39. ------------------------------------------------------------------------------*/
  40. void FreeAttributes (PCRYPT_ATTRIBUTES pAttributes);
  41. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  42. Function : GetAuthenticatedAttributes
  43. Synopsis : Encode and return authenticated attributes of the specified signer.
  44. Parameter: ISigner * pISigner - Pointer to ISigner.
  45. PCRYPT_ATTRIBUTES pAttributes
  46. Remark :
  47. ------------------------------------------------------------------------------*/
  48. HRESULT GetAuthenticatedAttributes (ISigner * pISigner,
  49. PCRYPT_ATTRIBUTES pAttributes);
  50. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  51. Function : IsValidForSigning
  52. Synopsis : Verify if the certificate is valid for signing.
  53. Parameter: PCCERT_CONTEXT pCertContext - CERT_CONTEXT of cert to verify.
  54. LPCSTR pszPolicy - Policy used to verify the cert (i.e.
  55. CERT_CHAIN_POLICY_BASE).
  56. Remark :
  57. ------------------------------------------------------------------------------*/
  58. HRESULT IsValidForSigning (PCCERT_CONTEXT pCertContext, LPCSTR pszPolicy);
  59. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  60. Function : GetSignerCert
  61. Synopsis : Retrieve signer's cert from ISigner object. If signer's cert is
  62. not available in the ISigner object, pop UI to prompt user to
  63. select a signing cert.
  64. Parameter: ISigner2 * pISigner2 - Pointer to ISigner2 or NULL.
  65. LPCSTR pszPolicy - Policy used to verify the cert (i.e.
  66. CERT_CHAIN_POLICY_BASE).
  67. CAPICOM_STORE_INFO StoreInfo - Store to select from.
  68. PFNCFILTERPROC pfnFilterCallback - Pointer to filter callback
  69. function.
  70. ISigner2 ** ppISigner2 - Pointer to pointer to ISigner2 to receive
  71. interface pointer.
  72. ICertificate ** ppICertificate - Pointer to pointer to ICertificate
  73. to receive interface pointer.
  74. PCCERT_CONTEXT * ppCertContext - Pointer to pointer to CERT_CONTEXT
  75. to receive cert context.
  76. Remark :
  77. ------------------------------------------------------------------------------*/
  78. HRESULT GetSignerCert (ISigner2 * pISigner2,
  79. LPCSTR pszPolicy,
  80. CAPICOM_STORE_INFO StoreInfo,
  81. PFNCFILTERPROC pfnFilterCallback,
  82. ISigner2 ** ppISigner2,
  83. ICertificate ** ppICertificate,
  84. PCCERT_CONTEXT * ppCertContext);
  85. #endif //__SIGNHLPR_H_