BLPAPI C++  3.24.11
Component blpapi_tlsoptions

Maintain client credentials and trust material. More...

Namespaces

 BloombergLP
 
 BloombergLP::blpapi
 

Classes

class  TlsOptions
 

Detailed Description

Maintain client credentials and trust material.

Purpose:
Maintain client credentials and trust material.
Classes:
blpapi::TlsOptions user specified TLS options.
See also
Component blpapi_sessionoptions
Description:
TlsOptions instances maintain client credentials and trust material used by a session to establish secure mutually authenticated connections to endpoints.
The client credentials comprise an encrypted private key with a client certificate. The trust material comprises one or more certificates.
TlsOptions objects are created using the methods TlsOptions::createFromBlobs and TlsOptions::createFromFiles; both accept the DER encoded client credentials in PKCS#12 format and the DER encoded trusted material in PKCS#7 format.
Usage:
The following snippet shows to use the TlsOptions when creating a SessionOptions.
blpapi::TlsOptions tlsOptionsFromFiles
= blpapi::TlsOptions::createFromFiles("client",
"mypassword",
"trusted");
tlsOptionsFromFiles.setTlsHandshakeTimeoutMs(123456);
SessionOptions sessionOptions1;
sessionOptions1.setTlsOptions(tlsOptionsFromFiles);
std::string credentials = getCredentials();
std::string password = getPassword();
std::string trustedCerts = getCerts();
blpapi::TlsOptions tlsOptionsFromBlobs
= blpapi::TlsOptions::createFromBlobs(credentials.data(),
credentials.size(),
password.c_str(),
trustedCerts.data(),
trustedCerts.size());
tlsOptionsFromBlobs.setCrlFetchTimeoutMs(234567);
SessionOptions sessionOptions2;
sessionOptions2.setTlsOptions(tlsOptionsFromBlobs);