19 #ifndef INCLUDE_RCF_OPENSSLENCRYPTIONFILTER_HPP 20 #define INCLUDE_RCF_OPENSSLENCRYPTIONFILTER_HPP 26 #include <RCF/Certificate.hpp> 28 #include <RCF/Filter.hpp> 29 #include <RCF/Export.hpp> 30 #include <RCF/Tools.hpp> 32 typedef struct ssl_st SSL;
33 typedef struct ssl_ctx_st SSL_CTX;
34 typedef struct x509_st X509;
45 class OpenSslEncryptionFilter;
46 class OpenSslEncryptionFilterImpl;
56 PemCertificate(
const std::string & pathToCert,
const std::string & password =
"");
62 friend class OpenSslEncryptionFilter;
63 friend class OpenSslEncryptionFilterFactory;
65 std::string mPathToCert;
66 std::string mPassword;
70 class OpenSslCryptoDll;
79 virtual CertificateImplementationType _getType()
85 std::string getCertificateName();
88 std::string getIssuerName();
98 OpenSslCryptoDll & mCryptoDll;
102 typedef std::shared_ptr<X509Certificate> X509CertificatePtr;
106 class RCF_EXPORT OpenSslEncryptionFilter :
public Filter, Noncopyable
109 int getFilterId()
const;
113 OpenSslEncryptionFilter(
115 SslRole sslRole = SslClient,
116 unsigned int bioBufferSize = 2048);
118 OpenSslEncryptionFilter(
119 const std::string & certificateFile,
120 const std::string & certificateFilePassword,
121 const std::string & caCertificate,
122 const std::string & ciphers,
124 SslRole sslRole = SslClient,
125 unsigned int bioBufferSize = 2048);
128 void read(
const ByteBuffer &byteBuffer, std::size_t bytesRequested);
129 void write(
const std::vector<ByteBuffer> &byteBuffers);
130 void onReadCompleted(
const ByteBuffer &byteBuffer);
131 void onWriteCompleted(std::size_t bytesTransferred);
139 friend class OpenSslEncryptionFilterImpl;
140 std::shared_ptr<OpenSslEncryptionFilterImpl> mImplPtr;
143 class OpenSslEncryptionFilterFactory :
public FilterFactory
146 OpenSslEncryptionFilterFactory();
148 FilterPtr createFilter(
RcfServer & server);
158 #endif // ! INCLUDE_RCF_OPENSSLENCRYPTIONFILTER_HPP Controls the client side of a RCF connection.
Definition: ClientStub.hpp:83
std::shared_ptr< Certificate > CertificatePtr
Reference counted wrapper for RCF::Certificate.
Definition: RcfFwd.hpp:109
std::function< bool(Certificate *)> CertificateValidationCallback
Describes user-provided callback functions for validating a certificate.
Definition: RcfFwd.hpp:115
Provides RCF server-side functionality.
Definition: RcfServer.hpp:54
Represents an in-memory certificate, usually from a remote peer. Only applicable to OpenSSL...
Definition: OpenSslEncryptionFilter.hpp:73
Definition: ByteBuffer.hpp:40
Definition: AmiIoHandler.hpp:24
Base class for all RCF certificate classes.
Definition: Certificate.hpp:30
Use this class to load a certificate from .pem format. Only applicable to OpenSSL.
Definition: OpenSslEncryptionFilter.hpp:49