#include <NetworkBackend.h>
|
| | NetworkBackend ()=default |
| |
| virtual | ~NetworkBackend () noexcept=default |
| |
| | NetworkBackend (const NetworkBackend &)=delete |
| |
| NetworkBackend & | operator= (const NetworkBackend &)=delete |
| |
| | CDOC_DISABLE_MOVE (NetworkBackend) |
| |
| virtual std::string | getLastErrorStr (result_t code) const |
| | Get the textual description of the last error.
|
| |
| virtual result_t | sendKey (CapsuleInfo &dst, const std::string &url, const std::vector< uint8_t > &rcpt_key, const std::vector< uint8_t > &key_material, const std::string &type, uint64_t expiry_ts) |
| | send key material to keyserver
|
| |
| virtual result_t | fetchKey (std::vector< uint8_t > &dst, const std::string &url, const std::string &transaction_id) |
| | fetch key material from keyserver
|
| |
| virtual result_t | getClientTLSCertificate (std::vector< uint8_t > &dst) |
| | get client TLS certificate in der format
|
| |
| virtual result_t | getPeerTLSCertificates (std::vector< std::vector< uint8_t > > &dst) |
| | get a list of peer TLS certificates in der format
|
| |
| virtual result_t | getPeerTLSCertificates (std::vector< std::vector< uint8_t > > &dst, const std::string &url) |
| | get a list of peer TLS certificates in der format
|
| |
| virtual result_t | getProxyCredentials (ProxyCredentials &credentials) const |
| | Get proxy configuration currently set.
|
| |
| virtual result_t | signTLS (std::vector< uint8_t > &dst, CryptoBackend::HashAlgorithm algorithm, const std::vector< uint8_t > &digest) |
| | sign TLS digest with client's private key
|
| |
◆ NetworkBackend() [1/2]
| libcdoc::NetworkBackend::NetworkBackend |
( |
| ) |
|
|
default |
◆ ~NetworkBackend()
| virtual libcdoc::NetworkBackend::~NetworkBackend |
( |
| ) |
|
|
virtualdefaultnoexcept |
◆ NetworkBackend() [2/2]
◆ CDOC_DISABLE_MOVE()
◆ fetchKey()
| virtual result_t libcdoc::NetworkBackend::fetchKey |
( |
std::vector< uint8_t > & |
dst, |
|
|
const std::string & |
url, |
|
|
const std::string & |
transaction_id |
|
) |
| |
|
virtual |
fetch key material from keyserver
The default implementation uses internal http client, peer TLS list and client TLS certificate
- Parameters
-
| dst | a destination container for key material |
| url | server url |
| transaction_id | transaction id of capsule |
- Returns
- error code or OK
◆ getClientTLSCertificate()
| virtual result_t libcdoc::NetworkBackend::getClientTLSCertificate |
( |
std::vector< uint8_t > & |
dst | ) |
|
|
inlinevirtual |
get client TLS certificate in der format
- Parameters
-
| dst | a destination container for certificate |
- Returns
- error code or OK
References libcdoc::NOT_IMPLEMENTED.
◆ getLastErrorStr()
| virtual std::string libcdoc::NetworkBackend::getLastErrorStr |
( |
result_t |
code | ) |
const |
|
virtual |
Get the textual description of the last error.
The result is undefined if the error code does not match the most recent error
- Parameters
-
- Returns
- std::string error description
◆ getPeerTLSCertificates() [1/2]
| virtual result_t libcdoc::NetworkBackend::getPeerTLSCertificates |
( |
std::vector< std::vector< uint8_t > > & |
dst | ) |
|
|
inlinevirtual |
get a list of peer TLS certificates in der format
- Parameters
-
| dst | a destination container for certificate |
- Returns
- error code or OK
References libcdoc::NOT_IMPLEMENTED.
◆ getPeerTLSCertificates() [2/2]
| virtual result_t libcdoc::NetworkBackend::getPeerTLSCertificates |
( |
std::vector< std::vector< uint8_t > > & |
dst, |
|
|
const std::string & |
url |
|
) |
| |
|
inlinevirtual |
get a list of peer TLS certificates in der format
- Parameters
-
| dst | a destination container for certificate |
| url | the base url ("https://servername:port/") |
- Returns
- error code or OK
◆ getProxyCredentials()
Get proxy configuration currently set.
- Parameters
-
| credentials | output for proxy credentials |
References libcdoc::NOT_IMPLEMENTED.
◆ operator=()
◆ sendKey()
| virtual result_t libcdoc::NetworkBackend::sendKey |
( |
CapsuleInfo & |
dst, |
|
|
const std::string & |
url, |
|
|
const std::vector< uint8_t > & |
rcpt_key, |
|
|
const std::vector< uint8_t > & |
key_material, |
|
|
const std::string & |
type, |
|
|
uint64_t |
expiry_ts |
|
) |
| |
|
virtual |
send key material to keyserver
The default implementation uses internal http client and peer TLS certificate list.
- Parameters
-
| dst | the transaction id and expiry date of the capsule on server |
| url | server url |
| rcpt_key | recipient's public key |
| key_material | encrypted KEK or ECDH public Key used to derive shared secret |
| type | algorithm type, currently either "rsa" or "ecc_secp384r1" |
| expiry_ts | the requested capsule expiry timestamp, 0 - use server default |
- Returns
- error code or OK
◆ signTLS()
sign TLS digest with client's private key
- Parameters
-
| dst | a destination container for signature |
| algorithm | signing algorithm |
| digest | data to be signed |
- Returns
- error code or OK
References libcdoc::NOT_IMPLEMENTED.
◆ NETWORK_ERROR
| constexpr int libcdoc::NetworkBackend::NETWORK_ERROR = -300 |
|
staticconstexpr |
The documentation for this struct was generated from the following file: