#include <http_key_fetcher.h>
|
Status | FetchKeys (const std::string &url, const std::string &request, std::string *response) override |
|
virtual Status | Get (const std::string &url, std::string *response) |
|
virtual Status | Post (const std::string &url, const std::string &data, std::string *response) |
|
void | SetClientCertInfo (const std::string &cert_file, const std::string &private_key_file, const std::string &private_key_password) |
|
void | SetCaFile (const std::string &ca_file) |
|
A KeyFetcher implementation that retrieves keys over HTTP(s). This class is not fully thread safe. It can be used in multi-thread environment once constructed, but it may not be safe to create a HttpKeyFetcher object when any other thread is running due to use of curl_global_init.
Definition at line 26 of file http_key_fetcher.h.
◆ HttpKeyFetcher()
shaka::media::HttpKeyFetcher::HttpKeyFetcher |
( |
uint32_t |
timeout_in_seconds | ) |
|
Create a fetcher with timeout.
- Parameters
-
timeout_in_seconds | specifies the timeout in seconds. |
Definition at line 139 of file http_key_fetcher.cc.
◆ FetchKeys()
Status shaka::media::HttpKeyFetcher::FetchKeys |
( |
const std::string & |
service_address, |
|
|
const std::string & |
request, |
|
|
std::string * |
response |
|
) |
| |
|
overridevirtual |
Fetch Keys from license service. |response| is owned by caller.
- Parameters
-
service_address | license service address. |
request | JSON formatted request. |
response | JSON formatted response. Owned by caller. |
- Returns
- OK on success.
Implements shaka::media::KeyFetcher.
Definition at line 144 of file http_key_fetcher.cc.
◆ Get()
Status shaka::media::HttpKeyFetcher::Get |
( |
const std::string & |
url, |
|
|
std::string * |
response |
|
) |
| |
|
virtual |
Fetch content using HTTP GET.
- Parameters
-
| url | specifies the content URL. |
[out] | response | will contain the body of the http response on success. It should not be NULL. |
- Returns
- OK on success.
Definition at line 150 of file http_key_fetcher.cc.
◆ Post()
Status shaka::media::HttpKeyFetcher::Post |
( |
const std::string & |
url, |
|
|
const std::string & |
data, |
|
|
std::string * |
response |
|
) |
| |
|
virtual |
Fetch content using HTTP POST.
- Parameters
-
| url | specifies the content URL. |
[out] | response | will contain the body of the http response on success. It should not be NULL. |
- Returns
- OK on success.
Definition at line 154 of file http_key_fetcher.cc.
◆ SetCaFile()
void shaka::media::HttpKeyFetcher::SetCaFile |
( |
const std::string & |
ca_file | ) |
|
|
inline |
Sets the Certifiate Authority file information for http requests.
- Parameters
-
ca_file | absolute path to the client certificate |
Definition at line 70 of file http_key_fetcher.h.
◆ SetClientCertInfo()
void shaka::media::HttpKeyFetcher::SetClientCertInfo |
( |
const std::string & |
cert_file, |
|
|
const std::string & |
private_key_file, |
|
|
const std::string & |
private_key_password |
|
) |
| |
|
inline |
Sets client certificate information for http requests.
- Parameters
-
cert_file | absolute path to the client certificate. |
private_key_file | absolute path to the client certificate private key file. |
private_key_password | private key password. |
Definition at line 61 of file http_key_fetcher.h.
The documentation for this class was generated from the following files: