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.

58 lines
1.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1997
  6. //
  7. // File: cert.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // Cert.h
  11. #ifndef __CERT_H_INCLUDED__
  12. #define __CERT_H_INCLUDED__
  13. #include "util.h" // structure TBLOB
  14. class CCertificate
  15. {
  16. protected:
  17. PCCERT_CONTEXT m_paCertContext; // Pointer to allocated certificate
  18. TBLOB m_blobCertData; // Raw data read from the file
  19. // Default flag for CertNameToStr()
  20. enum { c_dwCertNameStrType = CERT_X500_NAME_STR };
  21. public:
  22. CCertificate();
  23. ~CCertificate();
  24. BOOL FLoadCertificate(LPCTSTR szFile);
  25. void CertNameToCString(
  26. IN DWORD dwCertEncodingType,
  27. IN CERT_NAME_BLOB * pName,
  28. OUT CString * pstrData);
  29. void GetIssuer(OUT CString * pstrName);
  30. void GetSubject(OUT CString * pstrName);
  31. void GetAltSubject(OUT CString * pstrName);
  32. void GetSimString(OUT CString * pstrData);
  33. }; // CCertificate
  34. // Those strings are not subject to localization
  35. const TCHAR szX509[] = _T("X509:");
  36. const TCHAR szKerberos[] = _T("Kerberos:");
  37. #define cchX509 (ARRAYLEN(szX509) - 1)
  38. #define cchKerberos (ARRAYLEN(szKerberos) - 1)
  39. // Strings with angle brackets
  40. const TCHAR szSimIssuer[] = _T("<I>");
  41. const TCHAR szSimSubject[] = _T("<S>");
  42. const TCHAR szSimAltSubject[] = _T("<AS>");
  43. #endif // ~__CERT_H_INCLUDED__