19 #ifndef INCLUDE_RCF_WIN32CERTIFICATE_HPP
20 #define INCLUDE_RCF_WIN32CERTIFICATE_HPP
22 #include <RCF/Certificate.hpp>
24 #include <RCF/ByteBuffer.hpp>
25 #include <RCF/util/Tchar.hpp>
34 class RCF_EXPORT Win32Certificate :
public Certificate
38 Win32Certificate(PCCERT_CONTEXT pContext);
43 virtual CertificateImplementationType _getType()
49 tstring getCertificateName();
52 tstring getIssuerName();
55 void exportToPfx(
const std::string & pfxFilePath);
59 Win32CertificatePtr findRootCertificate(
60 Win32CertificateLocation certStoreLocation,
61 Win32CertificateStore certStore);
65 PCCERT_CONTEXT getWin32Context();
69 void setHasBeenDeleted()
71 mHasBeenDeleted =
true;
74 tstring getSubjectName();
75 tstring getOrganizationName();
76 tstring getCertAttribute(
const char * whichAttr);
78 RCF::ByteBuffer exportToPfx();
82 PCCERT_CONTEXT mpCert;
88 class RCF_EXPORT PfxCertificate :
public Win32Certificate
96 const std::string & pathToCert,
97 const tstring & password,
98 const tstring & certName);
102 Win32CertificateLocation certStoreLocation,
103 Win32CertificateStore certStore);
108 ByteBuffer certPfxBlob,
109 const tstring & password,
110 const tstring & certName);
118 const tstring & password,
119 const tstring & certName);
122 const std::string & pathToCert,
123 const RCF::tstring & password,
124 const RCF::tstring & certName);
126 HCERTSTORE mPfxStore;
130 class RCF_EXPORT StoreCertificate :
public Win32Certificate
138 Win32CertificateLocation certStoreLocation,
139 Win32CertificateStore certStore,
140 const tstring & certName);
143 void removeFromStore();
154 class RCF_EXPORT StoreCertificateIterator
161 StoreCertificateIterator(
162 Win32CertificateLocation certStoreLocation,
163 Win32CertificateStore certStore);
172 Win32CertificatePtr current();
176 ~StoreCertificateIterator();
180 HCERTSTORE mhCertStore;
181 PCCERT_CONTEXT mpCertIterator;
182 Win32CertificatePtr mCurrentCertPtr;
187 #endif // ! INCLUDE_RCF_WIN32CERTIFICATE_HPP