19 #ifndef INCLUDE_RCF_SCHANNEL_HPP
20 #define INCLUDE_RCF_SCHANNEL_HPP
22 #include <RCF/Filter.hpp>
23 #include <RCF/SspiFilter.hpp>
24 #include <RCF/util/Tchar.hpp>
31 #define SP_PROT_NONE 0
37 static const ULONG DefaultSchannelContextRequirements =
38 ASC_REQ_SEQUENCE_DETECT |
39 ASC_REQ_REPLAY_DETECT |
40 ASC_REQ_CONFIDENTIALITY |
41 ASC_REQ_EXTENDED_ERROR |
42 ASC_REQ_ALLOCATE_MEMORY |
45 class SchannelServerFilter :
public SspiServerFilter
50 DWORD enabledProtocols,
51 ULONG contextRequirements);
53 int getFilterId()
const;
56 class SchannelFilterFactory :
public FilterFactory
60 SchannelFilterFactory(
61 DWORD enabledProtocols = SP_PROT_TLS1_SERVER,
62 ULONG contextRequirements = DefaultSchannelContextRequirements);
64 FilterPtr createFilter(RcfServer & server);
69 ULONG mContextRequirements;
70 DWORD mEnabledProtocols;
73 class SchannelClientFilter :
public SspiClientFilter
77 ClientStub * pClientStub,
78 DWORD enabledProtocols = SP_PROT_NONE,
79 ULONG contextRequirements = DefaultSchannelContextRequirements);
81 int getFilterId()
const;
84 typedef SchannelClientFilter SchannelFilter;
88 class Win32Certificate;
89 typedef boost::shared_ptr<Win32Certificate> Win32CertificatePtr;
92 class RCF_EXPORT Win32Certificate :
public Certificate
96 Win32Certificate(PCCERT_CONTEXT pContext);
101 virtual CertificateImplementationType _getType()
107 tstring getCertificateName();
110 tstring getIssuerName();
113 void exportToPfx(
const std::string & pfxFilePath);
117 Win32CertificatePtr findRootCertificate(
118 Win32CertificateLocation certStoreLocation,
119 Win32CertificateStore certStore);
123 PCCERT_CONTEXT getWin32Context();
127 void setHasBeenDeleted()
129 mHasBeenDeleted =
true;
132 tstring getSubjectName();
133 tstring getOrganizationName();
134 tstring getCertAttribute(
const char * whichAttr);
136 RCF::ByteBuffer exportToPfx();
140 PCCERT_CONTEXT mpCert;
141 bool mHasBeenDeleted;
146 class RCF_EXPORT PfxCertificate :
public Win32Certificate
154 const std::string & pathToCert,
155 const tstring & password,
156 const tstring & certName);
160 Win32CertificateLocation certStoreLocation,
161 Win32CertificateStore certStore);
166 ByteBuffer certPfxBlob,
167 const tstring & password,
168 const tstring & certName);
176 const tstring & password,
177 const tstring & certName);
180 const std::string & pathToCert,
181 const RCF::tstring & password,
182 const RCF::tstring & certName);
184 HCERTSTORE mPfxStore;
188 class RCF_EXPORT StoreCertificate :
public Win32Certificate
196 Win32CertificateLocation certStoreLocation,
197 Win32CertificateStore certStore,
198 const tstring & certName);
201 void removeFromStore();
212 class RCF_EXPORT StoreCertificateIterator
219 StoreCertificateIterator(
220 Win32CertificateLocation certStoreLocation,
221 Win32CertificateStore certStore);
230 Win32CertificatePtr current();
234 ~StoreCertificateIterator();
238 HCERTSTORE mhCertStore;
239 PCCERT_CONTEXT mpCertIterator;
240 Win32CertificatePtr mCurrentCertPtr;
245 #endif // ! INCLUDE_RCF_SCHANNEL_HPP