Ice 3.7 C++98 API Reference
Loading...
Searching...
No Matches
OpenSSL.h
Go to the documentation of this file.
1//
2// Copyright (c) ZeroC, Inc. All rights reserved.
3//
4
5#ifndef ICESSL_OPENSSL_H
6#define ICESSL_OPENSSL_H
7
8#include <IceSSL/Plugin.h>
9
10#include <openssl/x509v3.h>
11#include <openssl/pem.h>
12
13//
14// Automatically link IceSSLOpenSSL[D|++11|++11D].lib with Visual C++
15//
16#if defined(_MSC_VER)
17# if !defined(ICE_BUILDING_ICESSL_OPENSSL) && defined(ICESSL_OPENSSL_API_EXPORTS)
18# define ICE_BUILDING_ICESSL_OPENSSL
19# endif
20
21# if !defined(ICE_BUILDING_ICESSL_OPENSSL)
22# pragma comment(lib, ICE_LIBNAME("IceSSLOpenSSL"))
23# endif
24#endif
25
26#ifndef ICESSL_OPENSSL_API
27# if defined(ICE_STATIC_LIBS)
28# define ICESSL_OPENSSL_API /**/
29# elif defined(ICESSL_OPENSSL_API_EXPORTS)
30# define ICESSL_OPENSSL_API ICE_DECLSPEC_EXPORT
31# else
32# define ICESSL_OPENSSL_API ICE_DECLSPEC_IMPORT
33# endif
34#endif
35
36#if defined(_WIN32) && !defined(ICESSL_OPENSSL_API_EXPORTS)
37
38namespace Ice
39{
40
48ICE_PLUGIN_REGISTER_DECLSPEC_IMPORT void registerIceSSLOpenSSL(bool loadOnInitialize = true);
49
50}
51#endif
52
53namespace IceSSL
54{
55
56namespace OpenSSL
57{
58
59class Certificate;
61
67{
68public:
69
77 static CertificatePtr create(x509_st* cert);
78
86 static CertificatePtr load(const std::string& file);
87
94 static CertificatePtr decode(const std::string& cert);
95
101 virtual x509_st* getCert() const = 0;
102};
103
109{
110public:
111
116 virtual Ice::Long getOpenSSLVersion() const = 0;
117
132 virtual void setContext(SSL_CTX* ctx) = 0;
133
139 virtual SSL_CTX* getContext() = 0;
140};
142
143} // OpenSSL namespace end
144
145} // IceSSL namespace end
146
147#endif
#define ICE_DEFINE_PTR(TPtr, T)
Definition Config.h:377
#define ICESSL_OPENSSL_API
Definition OpenSSL.h:32
#define ICE_PLUGIN_REGISTER_DECLSPEC_IMPORT
Definition RegisterPlugins.h:24
This convenience class is a wrapper around a native certificate.
Definition Plugin.h:412
Encapsulates an OpenSSL X.509 certificate.
Definition OpenSSL.h:67
static CertificatePtr create(x509_st *cert)
Construct a certificate using a native certificate.
static CertificatePtr decode(const std::string &cert)
Decode a certificate from a string that uses the PEM encoding format.
virtual x509_st * getCert() const =0
Retrieve the native X509 certificate value wrapped by this object.
static CertificatePtr load(const std::string &file)
Load the certificate from a file.
Represents the IceSSL plug-in object.
Definition OpenSSL.h:109
virtual void setContext(SSL_CTX *ctx)=0
Establishes the OpenSSL context.
virtual SSL_CTX * getContext()=0
Obtains the SSL context.
virtual Ice::Long getOpenSSLVersion() const =0
Obtains the OpenSSL version number.
Represents the IceSSL plug-in object.
Definition Plugin.h:665
Definition OpenSSL.h:57
::IceUtil::Handle< Certificate > CertificatePtr
Definition OpenSSL.h:60
::IceUtil::Handle< Plugin > PluginPtr
Definition OpenSSL.h:141
Definition ConnectionInfo.h:138
Definition BuiltinSequences.h:113
IceUtil::Int64 Long
The mapping for the Slice long type.
Definition Config.h:60