Skip to main content

ERUCES::TECertAndPKey

#include <tecert_pkey.h>

The TECertAndPKey class is used for TLS mutual authentication.

The TECertAndPKey represents an authentication context used for TLS Mutual connection. This class is derived from TEAuthenticationContext class.

© Pi Soft, 2018-2026 · Tricryption Engine 8.1

Public Member Functions​

MemberDescription
TECertAndPKey()The TECertAndPKey constructor is the default class constructor.
TECertAndPKey(const TECertAndPKey &)The TECertAndPKey copy constructor copies the certificate and the private key.
TECertAndPKey & operator=(const TECertAndPKey &)The = operator assigns a deep copy of the source's certificate and private key (self-assignment safe).
~TECertAndPKey()The TECertAndPKey constructor is the class destructor.
void loadFromFile(_TESTD string &pkcs7file, _TESTD string &pkcs8file, _TESTD string &passwd)
void loadFromX509File(const _TESTD string &x509file)The loadFromX509File method loads the certificate information from a X.509 file.
_TESTD string getCertificate()The getCertificate method retrieves a string representing the certficate.
_TESTD string getPrivateKey()The getPrivateKey method retrieves a string representing the private key.

Member Function Documentation​

TECertAndPKey()​

The TECertAndPKey constructor is the default class constructor.

TECertAndPKey(const TECertAndPKey &)​

The TECertAndPKey copy constructor copies the certificate and the private key.

TE81-448 (W36 round 1): the class owned two strings with neither special member declared, so the implicit copy shared both and the two destructors freed them twice. A deep copy now, and the = operator below likewise.

TECertAndPKey & operator=(const TECertAndPKey &)​

The = operator assigns a deep copy of the source's certificate and private key (self-assignment safe).

~TECertAndPKey()​

The TECertAndPKey constructor is the class destructor.

void loadFromFile(_TESTD string &pkcs7file, _TESTD string &pkcs8file, _TESTD string &passwd)​

The loadFromFile method loads the certificate information from a file.

Parameters

ParameterDescription
pkcs7fileA PKCS 7 file to load
pkcs8fileA PKCS 8 file to load.
passwdThe password to unload the private key.

void loadFromX509File(const _TESTD string &x509file)​

The loadFromX509File method loads the certificate information from a X.509 file.

Parameters

ParameterDescription
x509fileAn X.509 file to load.

_TESTD string getCertificate()​

The getCertificate method retrieves a string representing the certficate.

_TESTD string getPrivateKey()​

The getPrivateKey method retrieves a string representing the private key.