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.

101 lines
2.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: cert.h
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 09-23-97 jbanes Ported over SGC stuff from NT 4 tree.
  15. // 01-05-98 jbanes Use WinVerifyTrust to validate certs.
  16. //
  17. //----------------------------------------------------------------------------
  18. #define SERIALNUMBER_LENGTH 16
  19. DWORD
  20. MapOidToKeyExch(LPSTR szOid);
  21. DWORD
  22. MapOidToCertType(LPSTR szOid);
  23. SP_STATUS
  24. SPLoadCertificate(
  25. DWORD fProtocol,
  26. DWORD dwCertEncodingType,
  27. PUCHAR pCertificate,
  28. DWORD cbCertificate,
  29. PCCERT_CONTEXT *ppCertContext);
  30. SECURITY_STATUS
  31. MapWinTrustError(
  32. SECURITY_STATUS Status,
  33. SECURITY_STATUS DefaultError,
  34. DWORD dwIgnoreErrors);
  35. NTSTATUS
  36. VerifyClientCertificate(
  37. PCCERT_CONTEXT pCertContext,
  38. DWORD dwCertFlags,
  39. DWORD dwIgnoreErrors,
  40. LPCSTR pszPolicyOID,
  41. PCCERT_CHAIN_CONTEXT *ppChainContext); // optional
  42. NTSTATUS
  43. AutoVerifyServerCertificate(
  44. PSPContext pContext);
  45. NTSTATUS
  46. VerifyServerCertificate(
  47. PSPContext pContext,
  48. DWORD dwCertFlags,
  49. DWORD dwIgnoreErrors);
  50. SECURITY_STATUS
  51. SPCheckKeyUsage(
  52. PCCERT_CONTEXT pCertContext,
  53. PSTR pszUsage,
  54. BOOL fOnCertOnly,
  55. PBOOL pfIsAllowed);
  56. SP_STATUS
  57. SPPublicKeyFromCert(
  58. PCCERT_CONTEXT pCert,
  59. PUBLICKEY ** ppKey,
  60. ExchSpec * pdwExchSpec);
  61. SP_STATUS
  62. RsaPublicKeyFromCert(
  63. PCERT_PUBLIC_KEY_INFO pPublicKeyInfo,
  64. BLOBHEADER *pBlob,
  65. PDWORD pcbBlob);
  66. SP_STATUS
  67. DssPublicKeyFromCert(
  68. PCERT_PUBLIC_KEY_INFO pPublicKeyInfo,
  69. BLOBHEADER *pBlob,
  70. PDWORD pcbBlob);
  71. SP_STATUS
  72. SPSerializeCertificate(
  73. DWORD dwProtocol, // in
  74. BOOL fBuildChain, // in
  75. PBYTE * ppCertChain, // out
  76. DWORD * pcbCertChain, // out
  77. PCCERT_CONTEXT pCertContext, // in
  78. DWORD dwChainingFlags); // in
  79. SP_STATUS
  80. ExtractIssuerNamesFromStore(
  81. HCERTSTORE hStore,
  82. PBYTE pbIssuers,
  83. DWORD *pcbIssuers);