18 #ifndef INCLUDE_RCF_OPENSSLENCRYPTIONFILTER_HPP 19 #define INCLUDE_RCF_OPENSSLENCRYPTIONFILTER_HPP 25 #include <RCF/Certificate.hpp> 27 #include <RCF/Filter.hpp> 28 #include <RCF/Export.hpp> 29 #include <RCF/Tools.hpp> 31 typedef struct ssl_st SSL;
32 typedef struct ssl_ctx_st SSL_CTX;
33 typedef struct x509_st X509;
44 class OpenSslEncryptionFilter;
45 class OpenSslEncryptionFilterImpl;
55 PemCertificate(
const std::string & pathToCert,
const std::string & password =
"");
61 friend class OpenSslEncryptionFilter;
62 friend class OpenSslEncryptionFilterFactory;
64 std::string mPathToCert;
65 std::string mPassword;
69 class OpenSslCryptoDll;
78 virtual CertificateImplementationType _getType()
84 std::string getCertificateName();
87 std::string getIssuerName();
97 OpenSslCryptoDll & mCryptoDll;
101 typedef std::shared_ptr<X509Certificate> X509CertificatePtr;
105 class RCF_EXPORT OpenSslEncryptionFilter :
public Filter, Noncopyable
108 int getFilterId()
const;
112 OpenSslEncryptionFilter(
114 SslRole sslRole = SslClient,
115 unsigned int bioBufferSize = 2048);
117 OpenSslEncryptionFilter(
118 const std::string & certificateFile,
119 const std::string & certificateFilePassword,
120 const std::string & caCertificate,
121 const std::string & ciphers,
123 SslRole sslRole = SslClient,
124 unsigned int bioBufferSize = 2048);
127 void read(
const ByteBuffer &byteBuffer, std::size_t bytesRequested);
128 void write(
const std::vector<ByteBuffer> &byteBuffers);
129 void onReadCompleted(
const ByteBuffer &byteBuffer);
130 void onWriteCompleted(std::size_t bytesTransferred);
138 friend class OpenSslEncryptionFilterImpl;
139 std::shared_ptr<OpenSslEncryptionFilterImpl> mImplPtr;
142 class OpenSslEncryptionFilterFactory :
public FilterFactory
145 OpenSslEncryptionFilterFactory();
147 FilterPtr createFilter(
RcfServer & server);
157 #endif // ! INCLUDE_RCF_OPENSSLENCRYPTIONFILTER_HPP Controls the client side of a RCF connection.
Definition: ClientStub.hpp:82
std::shared_ptr< Certificate > CertificatePtr
Reference counted wrapper for RCF::Certificate.
Definition: RcfFwd.hpp:108
std::function< bool(Certificate *)> CertificateValidationCallback
Describes user-provided callback functions for validating a certificate.
Definition: RcfFwd.hpp:114
Provides RCF server-side functionality.
Definition: RcfServer.hpp:53
Represents an in-memory certificate, usually from a remote peer. Only applicable to OpenSSL...
Definition: OpenSslEncryptionFilter.hpp:72
Definition: ByteBuffer.hpp:39
Definition: AmiIoHandler.hpp:23
Base class for all RCF certificate classes.
Definition: Certificate.hpp:29
Use this class to load a certificate from .pem format. Only applicable to OpenSSL.
Definition: OpenSslEncryptionFilter.hpp:48