shaka-packager/docs/d7/de0/classshaka_1_1media_1_1Http...

390 lines
19 KiB
HTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
2018-02-10 23:37:42 +00:00
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Shaka Packager SDK: shaka::media::HttpKeyFetcher Class Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
2018-02-10 23:37:42 +00:00
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
2018-02-10 23:37:42 +00:00
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Shaka Packager SDK
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
2018-02-10 23:37:42 +00:00
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
2018-02-10 23:37:42 +00:00
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
2018-02-10 23:37:42 +00:00
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="../../d8/daf/namespaceshaka.html">shaka</a></li><li class="navelem"><b>media</b></li><li class="navelem"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html">HttpKeyFetcher</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="../../d0/d0e/classshaka_1_1media_1_1HttpKeyFetcher-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">shaka::media::HttpKeyFetcher Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="../../db/d71/http__key__fetcher_8h_source.html">http_key_fetcher.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for shaka::media::HttpKeyFetcher:</div>
<div class="dyncontent">
<div class="center">
<img src="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.png" usemap="#shaka::media::HttpKeyFetcher_map" alt=""/>
<map id="shaka::media::HttpKeyFetcher_map" name="shaka::media::HttpKeyFetcher_map">
<area href="../../df/d66/classshaka_1_1media_1_1KeyFetcher.html" title="Base class for fetching keys from the license service. " alt="shaka::media::KeyFetcher" shape="rect" coords="0,0,178,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
2018-02-10 23:37:42 +00:00
<tr class="memitem:a02561dcbbaf66152dce3ebd466810f15"><td class="memItemLeft" align="right" valign="top"><a id="a02561dcbbaf66152dce3ebd466810f15"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#a02561dcbbaf66152dce3ebd466810f15">HttpKeyFetcher</a> ()</td></tr>
2018-02-10 23:37:42 +00:00
<tr class="memdesc:a02561dcbbaf66152dce3ebd466810f15"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a fetcher with no timeout. <br /></td></tr>
<tr class="separator:a02561dcbbaf66152dce3ebd466810f15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11829a5c6e3507998c4d93c83c3069a4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#a11829a5c6e3507998c4d93c83c3069a4">HttpKeyFetcher</a> (uint32_t timeout_in_seconds)</td></tr>
<tr class="separator:a11829a5c6e3507998c4d93c83c3069a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
KeyFetcher implementation overrides.</h2></td></tr>
<tr class="memitem:ab8e9b01fac00aa5dafb8983acd7a297b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#ab8e9b01fac00aa5dafb8983acd7a297b">FetchKeys</a> (const std::string &amp;url, const std::string &amp;request, std::string *response) override</td></tr>
<tr class="separator:ab8e9b01fac00aa5dafb8983acd7a297b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b5b2c193d6055ca49d2d6af2b2ac4cc"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#a6b5b2c193d6055ca49d2d6af2b2ac4cc">Get</a> (const std::string &amp;url, std::string *response)</td></tr>
<tr class="separator:a6b5b2c193d6055ca49d2d6af2b2ac4cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31e904e2f802e5626c4420675c76d513"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#a31e904e2f802e5626c4420675c76d513">Post</a> (const std::string &amp;url, const std::string &amp;data, std::string *response)</td></tr>
<tr class="separator:a31e904e2f802e5626c4420675c76d513"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ed8d56dddc800d76b57ed3674f01270"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#a2ed8d56dddc800d76b57ed3674f01270">SetClientCertInfo</a> (const std::string &amp;cert_file, const std::string &amp;private_key_file, const std::string &amp;private_key_password)</td></tr>
<tr class="separator:a2ed8d56dddc800d76b57ed3674f01270"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8420a100f8ff8e86c6bc95642ce29d0b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#a8420a100f8ff8e86c6bc95642ce29d0b">SetCaFile</a> (const std::string &amp;ca_file)</td></tr>
<tr class="separator:a8420a100f8ff8e86c6bc95642ce29d0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A <a class="el" href="../../df/d66/classshaka_1_1media_1_1KeyFetcher.html" title="Base class for fetching keys from the license service. ">KeyFetcher</a> 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 <a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html">HttpKeyFetcher</a> object when any other thread is running due to use of curl_global_init. </p>
2018-02-10 23:37:42 +00:00
<p class="definition">Definition at line <a class="el" href="../../db/d71/http__key__fetcher_8h_source.html#l00026">26</a> of file <a class="el" href="../../db/d71/http__key__fetcher_8h_source.html">http_key_fetcher.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
2018-02-10 23:37:42 +00:00
<a id="a11829a5c6e3507998c4d93c83c3069a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a11829a5c6e3507998c4d93c83c3069a4">&#9670;&nbsp;</a></span>HttpKeyFetcher()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">shaka::media::HttpKeyFetcher::HttpKeyFetcher </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>timeout_in_seconds</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
2018-02-10 23:37:42 +00:00
<p>Create a fetcher with timeout. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">timeout_in_seconds</td><td>specifies the timeout in seconds. </td></tr>
</table>
</dd>
</dl>
2018-05-23 23:12:00 +00:00
<p class="definition">Definition at line <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html#l00133">133</a> of file <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html">http_key_fetcher.cc</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
2018-02-10 23:37:42 +00:00
<a id="ab8e9b01fac00aa5dafb8983acd7a297b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab8e9b01fac00aa5dafb8983acd7a297b">&#9670;&nbsp;</a></span>FetchKeys()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a> shaka::media::HttpKeyFetcher::FetchKeys </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>service_address</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>request</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string *&#160;</td>
<td class="paramname"><em>response</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
2018-02-10 23:37:42 +00:00
<p>Fetch Keys from license service. |response| is owned by caller. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">service_address</td><td>license service address. </td></tr>
<tr><td class="paramname">request</td><td>JSON formatted request. </td></tr>
<tr><td class="paramname">response</td><td>JSON formatted response. Owned by caller. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>OK on success. </dd></dl>
<p>Implements <a class="el" href="../../df/d66/classshaka_1_1media_1_1KeyFetcher.html#aa3c6011a0dd7c8e7f53dbaf48b92718d">shaka::media::KeyFetcher</a>.</p>
2018-05-23 23:12:00 +00:00
<p class="definition">Definition at line <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html#l00138">138</a> of file <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html">http_key_fetcher.cc</a>.</p>
</div>
</div>
2018-02-10 23:37:42 +00:00
<a id="a6b5b2c193d6055ca49d2d6af2b2ac4cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6b5b2c193d6055ca49d2d6af2b2ac4cc">&#9670;&nbsp;</a></span>Get()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a> shaka::media::HttpKeyFetcher::Get </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>url</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string *&#160;</td>
<td class="paramname"><em>response</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
2018-02-10 23:37:42 +00:00
<p>Fetch content using HTTP GET. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir"></td><td class="paramname">url</td><td>specifies the content URL. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">response</td><td>will contain the body of the http response on success. It should not be NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>OK on success. </dd></dl>
2018-05-23 23:12:00 +00:00
<p class="definition">Definition at line <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html#l00144">144</a> of file <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html">http_key_fetcher.cc</a>.</p>
</div>
</div>
2018-02-10 23:37:42 +00:00
<a id="a31e904e2f802e5626c4420675c76d513"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a31e904e2f802e5626c4420675c76d513">&#9670;&nbsp;</a></span>Post()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a> shaka::media::HttpKeyFetcher::Post </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>url</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string *&#160;</td>
<td class="paramname"><em>response</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
2018-02-10 23:37:42 +00:00
<p>Fetch content using HTTP POST. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir"></td><td class="paramname">url</td><td>specifies the content URL. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">response</td><td>will contain the body of the http response on success. It should not be NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>OK on success. </dd></dl>
2018-05-23 23:12:00 +00:00
<p class="definition">Definition at line <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html#l00148">148</a> of file <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html">http_key_fetcher.cc</a>.</p>
</div>
</div>
2018-02-10 23:37:42 +00:00
<a id="a8420a100f8ff8e86c6bc95642ce29d0b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8420a100f8ff8e86c6bc95642ce29d0b">&#9670;&nbsp;</a></span>SetCaFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void shaka::media::HttpKeyFetcher::SetCaFile </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>ca_file</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
2018-02-10 23:37:42 +00:00
<p>Sets the Certifiate Authority file information for http requests. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ca_file</td><td>absolute path to the client certificate </td></tr>
</table>
</dd>
</dl>
2018-02-10 23:37:42 +00:00
<p class="definition">Definition at line <a class="el" href="../../db/d71/http__key__fetcher_8h_source.html#l00070">70</a> of file <a class="el" href="../../db/d71/http__key__fetcher_8h_source.html">http_key_fetcher.h</a>.</p>
</div>
</div>
2018-02-10 23:37:42 +00:00
<a id="a2ed8d56dddc800d76b57ed3674f01270"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ed8d56dddc800d76b57ed3674f01270">&#9670;&nbsp;</a></span>SetClientCertInfo()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void shaka::media::HttpKeyFetcher::SetClientCertInfo </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>cert_file</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>private_key_file</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>private_key_password</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
2018-02-10 23:37:42 +00:00
<p>Sets client certificate information for http requests. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">cert_file</td><td>absolute path to the client certificate. </td></tr>
<tr><td class="paramname">private_key_file</td><td>absolute path to the client certificate private key file. </td></tr>
<tr><td class="paramname">private_key_password</td><td>private key password. </td></tr>
</table>
</dd>
</dl>
2018-02-10 23:37:42 +00:00
<p class="definition">Definition at line <a class="el" href="../../db/d71/http__key__fetcher_8h_source.html#l00061">61</a> of file <a class="el" href="../../db/d71/http__key__fetcher_8h_source.html">http_key_fetcher.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>packager/media/base/<a class="el" href="../../db/d71/http__key__fetcher_8h_source.html">http_key_fetcher.h</a></li>
<li>packager/media/base/<a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html">http_key_fetcher.cc</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Dec 20 2018 14:37:44 for Shaka Packager SDK by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
2018-02-10 23:37:42 +00:00
</a> 1.8.13
</small></address>
</body>
</html>