PPL7-Icon Patrick's Programming Library Version 7.0.0 - Dokumentation
ppl7::SSLContext Klassenreferenz

SSL-Verschlüsselung. Mehr ...

Öffentliche Typen

enum  SSL_METHOD {
  SSLv2 = 1, SSLv2client, SSLv2server, SSLv3,
  SSLv3client, SSLv3server, TLSv1, TLSv1client,
  TLSv1server, SSLv23, SSLv23client, SSLv23server,
  TLSv1_1, TLSv1_1client, TLSv1_1server, TLSv1_2,
  TLSv1_2client, TLSv1_2server, TLS, TLSclient,
  TLSserver, DTLSv1, DTLSv1client, DTLSv1server
}
 

Öffentliche Methoden

 SSLContext ()
 
 SSLContext (int method)
 SSL-Kontext initialisieren. Mehr ...
 
 ~SSLContext ()
 
void init (int method=SSLv3)
 SSL-Kontext initialisieren. Mehr ...
 
bool isInit ()
 
void loadCertificate (const String &certificate, const String &privatekey=String(), const String &password=String())
 
void loadTrustedCAfromFile (const String &filename)
 
void loadTrustedCAfromPath (const String &path)
 
void * newSSL ()
 create a new SSL structure for a connection Mehr ...
 
void releaseSSL (void *ssl)
 free an allocated SSL structure Mehr ...
 
void setCipherList (const String &cipherlist)
 
void shutdown ()
 SSL-Kontext deinitialisieren. Mehr ...
 

Private Methoden

void clear ()
 

Private Attribute

void * ctx
 
Mutex mutex
 
int references
 

Freundbeziehungen

class CTCPSocket
 

Ausführliche Beschreibung

SSL-Schnittstelle.

Beispiel: TCP-Server mit SSL-Verschlüsselung

Dokumentation der Aufzählungstypen

Aufzählungswerte
SSLv2 
SSLv2client 
SSLv2server 
SSLv3 
SSLv3client 
SSLv3server 
TLSv1 
TLSv1client 
TLSv1server 
SSLv23 
SSLv23client 
SSLv23server 
TLSv1_1 
TLSv1_1client 
TLSv1_1server 
TLSv1_2 
TLSv1_2client 
TLSv1_2server 
TLS 
TLSclient 
TLSserver 
DTLSv1 
DTLSv1client 
DTLSv1server 

Beschreibung der Konstruktoren und Destruktoren

ppl7::SSLContext::SSLContext ( )
ppl7::SSLContext::SSLContext ( int  method)
Beschreibung:
Ausnahmebehandlung
UnsupportedFeatureException
OutOfMemoryException
InitializationFailedException
IllegalArgumentException
ppl7::SSLContext::~SSLContext ( )

Dokumentation der Elementfunktionen

void ppl7::SSLContext::clear ( )
private
void ppl7::SSLContext::init ( int  method = SSLv3)
Beschreibung:
Ausnahmebehandlung
UnsupportedFeatureException
OutOfMemoryException
InitializationFailedException
IllegalArgumentException
bool ppl7::SSLContext::isInit ( )
void ppl7::SSLContext::loadCertificate ( const String certificate,
const String privatekey = String(),
const String password = String() 
)
Beschreibung:
LoadCertificate wird benoetigt, wenn ein SSL-Server gestartet werden soll. LoadCertificate laed ein Zertifikat im PEM-Format oder eine komplette Trustchain im PEM-Format aus dem File "certificate". Wird "privatekey" angegeben, wird daraus der Private Key geladen. Wenn nicht, wird der Private Key ebenfalls in der "certificate"- Datei erwartet. Ist der Key durch ein Passwort geschuetzt, muss dieses als "password" angegeben werden.
void ppl7::SSLContext::loadTrustedCAfromFile ( const String filename)
void ppl7::SSLContext::loadTrustedCAfromPath ( const String path)
void * ppl7::SSLContext::newSSL ( )
Beschreibung:
creates a new SSL structure which is needed to hold the data for a TLS/SSL connection. The new structure inherits the settings of the underlying SSLContext:
  • connection method (SSLv2/v3/TLSv1)
  • options
  • verification settings
  • timeout settings.
Rückgabe
The function allocates memory to hold a SSL-Structure. It must be freed by using SSLContext::releaseSSL
Ausnahmebehandlung
UnsupportedFeatureException
SSLContextUninitializedException
SSLException
void ppl7::SSLContext::releaseSSL ( void *  ssl)
Beschreibung:
Decrements the reference count of ssl, and removes the SSL structure pointed to by ssl and frees up the allocated memory if the reference count has reached 0.
Parameter
sslPointer to SSL structure received by SSLContext::newSSL
Ausnahmebehandlung
UnsupportedFeatureExceptionis thrown, when OpenSSL is not supported
NullPointerExceptionis thrown when ssl points to NULL
SSLContextReferenceCounterMismatchExceptionis thrown, when the internal reference counter is already 0 when calling this function
void ppl7::SSLContext::setCipherList ( const String cipherlist)
void ppl7::SSLContext::shutdown ( )
Beschreibung:
Ausnahmebehandlung
SSLContextInUseException

Freundbeziehungen und Funktionsdokumentation

friend class CTCPSocket
friend

Dokumentation der Datenelemente

void* ppl7::SSLContext::ctx
private
Mutex ppl7::SSLContext::mutex
private
int ppl7::SSLContext::references
private

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Dateien: