SSLContext Class Reference

#include <SSLContext.h>

Public Member Functions

 SSLContext (const String &trustStore, SSLCertificateVerifyFunction *verifyCert, const String &randomFile=String::EMPTY)
 
 SSLContext (const SSLContext &sslContext)
 
 ~SSLContext ()
 
String getTrustStore () const
 
String getCertPath () const
 
String getKeyPath () const
 
String getCRLPath () const
 
X509_STORE * getCRLStore () const
 
Boolean isPeerVerificationEnabled () const
 
SSLCertificateVerifyFunction * getSSLCertificateVerifyFunction () const
 
 SSLContext (const String &trustStore, const String &certPath, const String &keyPath, SSLCertificateVerifyFunction *verifyCert, const String &randomFile)
 
 SSLContext (const String &trustStore, const String &certPath, const String &keyPath, const String &crlPath, SSLCertificateVerifyFunction *verifyCert, const String &randomFile)
 

Detailed Description

This class provides the interface that a client uses to create SSL context.

Constructor & Destructor Documentation

◆ SSLContext() [1/4]

SSLContext::SSLContext ( const String trustStore,
SSLCertificateVerifyFunction *  verifyCert,
const String randomFile = String::EMPTY 
)

Constructor for an SSLContext object.

Parameters
trustStorefile path of the trust store
verifyCertfunction pointer to a certificate verification call back function. A null pointer indicates that no callback is requested for certificate verification.
randomFilefile path of a random file that may be used as a seed for random number generation by OpenSSL.

NOTE: For platforms that support /dev/random(urandom), the /dev/random files will be used to seed OpenSSL. The specified random file may be used as a fallback when /dev/random(urandom) is unavailable or fails. Using /dev/random to seed OpenSSL is more secure than using a random file.

An empty random file string indicates that a random file should not be used. If sufficient randomness is not achieved using /dev/random and/or a random file, an SSLException is thrown.

Exceptions
SSLExceptionindicates failure to create an SSL context.

◆ SSLContext() [2/4]

SSLContext::SSLContext ( const SSLContext sslContext)

Constructs an SSLContext by copying another SSLContext object.

Parameters
sslContextThe SSLContext object to copy

◆ ~SSLContext()

SSLContext::~SSLContext ( )

Destructs an SSLContext object.

◆ SSLContext() [3/4]

SSLContext::SSLContext ( const String trustStore,
const String certPath,
const String keyPath,
SSLCertificateVerifyFunction *  verifyCert,
const String randomFile 
)

Constructor for an SSLContext object. This constructor is intended to be used by the CIMServer or CIMClient.

Parameters
trustStorefile path of the trust store.
certPathfile path of the server certificate.
keyPathfile path of the private key.
verifyCertfunction pointer to a certificate verification call back function. A null pointer indicates that no callback is requested for certificate verification.
randomFilefile path of a random file that may be used as a seed for random number generation by OpenSSL.

NOTE: For platforms that support /dev/random(urandom), the /dev/random files will be used to seed OpenSSL. The specified random file may be used as a fallback when /dev/random(urandom) is unavailable or fails. Using /dev/random to seed OpenSSL is more secure than using a random file.

An empty random file string indicates that a random file should not be used. If sufficient randomness is not achieved using /dev/random and/or a random file, an SSLException is thrown.

Exceptions
SSLExceptionindicates failure to create an SSL context.

◆ SSLContext() [4/4]

SSLContext::SSLContext ( const String trustStore,
const String certPath,
const String keyPath,
const String crlPath,
SSLCertificateVerifyFunction *  verifyCert,
const String randomFile 
)

Constructor for an SSLContext object. This constructor is intended to be used by the CIMServer or CIMClient.

Parameters
trustStorefile path of the trust store.
certPathfile path of the server certificate.
keyPathfile path of the private key.
crlPathfile path of the certificate revocation list.
verifyCertfunction pointer to a certificate verification call back function. A null pointer indicates that no callback is requested for certificate verification.
randomFilefile path of a random file that may be used as a seed for random number generation by OpenSSL.

NOTE: For platforms that support /dev/random(urandom), the /dev/random files will be used to seed OpenSSL. The specified random file may be used as a fallback when /dev/random(urandom) is unavailable or fails. Using /dev/random to seed OpenSSL is more secure than using a random file.

An empty random file string indicates that a random file should not be used. If sufficient randomness is not achieved using /dev/random and/or a random file, an SSLException is thrown.

Exceptions
SSLExceptionindicates failure to create an SSL context.

Member Function Documentation

◆ getCertPath()

String SSLContext::getCertPath ( ) const

Gets the x509 certificate path of the SSLContext object.

Returns
a string containing the certificate path.

◆ getCRLPath()

String SSLContext::getCRLPath ( ) const

Gets the certificate revocation list path of the SSLContext object.

Returns
a string containing the crl path

◆ getCRLStore()

X509_STORE* SSLContext::getCRLStore ( ) const

Gets the certificate revocation store of the SSLContext object.

Returns
a string containing the crl store

◆ getKeyPath()

String SSLContext::getKeyPath ( ) const

Gets the private key path of the SSLContext object.

Returns
a string containing the key path

◆ getSSLCertificateVerifyFunction()

SSLCertificateVerifyFunction* SSLContext::getSSLCertificateVerifyFunction ( ) const

Returns the verification callback associated with this context. This may be NULL.

Returns
the verification callback function

◆ getTrustStore()

String SSLContext::getTrustStore ( ) const

Gets the truststore path of the SSLContext object. This may be a CA file or a directory.

Returns
a string containing the truststore path.

◆ isPeerVerificationEnabled()

Boolean SSLContext::isPeerVerificationEnabled ( ) const

Returns whether peer verification is ON of OFF Corresponds to what the SSL_CTX_set_verify is set to

Returns
true if verification is on; false otherwise

The documentation for this class was generated from the following file:
  • /home/loongson/rpmbuild/BUILD/pegasus/src/Pegasus/Common/SSLContext.h