| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 | <!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"/><meta name="generator" content="Doxygen 1.8.11"/><title>GRPC C++: include/grpc++/security/credentials.h Source File</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"/><script type="text/javascript" src="search/searchdata.js"></script><script type="text/javascript" src="search/search.js"></script><script type="text/javascript">  $(document).ready(function() { init_search(); });</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;">  <td id="projectalign" style="padding-left: 0.5em;">   <div id="projectname">GRPC C++    <span id="projectnumber">1.0.0</span>   </div>  </td> </tr> </tbody></table></div><!-- end header part --><!-- Generated by Doxygen 1.8.11 --><script type="text/javascript">var searchBox = new SearchBox("searchBox", "search",false,'Search');</script>  <div id="navrow1" class="tabs">    <ul class="tablist">      <li><a href="index.html"><span>Main Page</span></a></li>      <li><a href="modules.html"><span>Modules</span></a></li>      <li><a href="namespaces.html"><span>Namespaces</span></a></li>      <li><a href="annotated.html"><span>Data Structures</span></a></li>      <li class="current"><a href="files.html"><span>Files</span></a></li>      <li>        <div id="MSearchBox" class="MSearchBoxInactive">        <span class="left">          <img id="MSearchSelect" src="search/mag_sel.png"               onmouseover="return searchBox.OnSearchSelectShow()"               onmouseout="return searchBox.OnSearchSelectHide()"               alt=""/>          <input type="text" id="MSearchField" value="Search" accesskey="S"               onfocus="searchBox.OnSearchFieldFocus(true)"                onblur="searchBox.OnSearchFieldFocus(false)"                onkeyup="searchBox.OnSearchFieldChange(event)"/>          </span><span class="right">            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>          </span>        </div>      </li>    </ul>  </div>  <div id="navrow2" class="tabs2">    <ul class="tablist">      <li><a href="files.html"><span>File List</span></a></li>      <li><a href="globals.html"><span>Globals</span></a></li>    </ul>  </div><!-- window showing the filter options --><div id="MSearchSelectWindow"     onmouseover="return searchBox.OnSearchSelectShow()"     onmouseout="return searchBox.OnSearchSelectHide()"     onkeydown="return searchBox.OnSearchSelectKey(event)"></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="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_f1b2ab2a88927c1e950e43c1cf4b634b.html">grpc++</a></li><li class="navelem"><a class="el" href="dir_7d74774c8f3e0db94d40932630f431b6.html">security</a></li>  </ul></div></div><!-- top --><div class="header">  <div class="headertitle"><div class="title">credentials.h</div>  </div></div><!--header--><div class="contents"><a href="credentials_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * Copyright 2015, Google Inc.</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * All rights reserved.</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * Redistribution and use in source and binary forms, with or without</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * modification, are permitted provided that the following conditions are</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * met:</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> *</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *     * Redistributions of source code must retain the above copyright</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * notice, this list of conditions and the following disclaimer.</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> *     * Redistributions in binary form must reproduce the above</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * copyright notice, this list of conditions and the following disclaimer</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * in the documentation and/or other materials provided with the</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> * distribution.</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> *     * Neither the name of Google Inc. nor the names of its</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * contributors may be used to endorse or promote products derived from</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * this software without specific prior written permission.</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> *</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span> <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment"> * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span> <span class="comment"> * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="comment"> * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="comment"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="comment"> *</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="comment"> */</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div><div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#ifndef GRPCXX_SECURITY_CREDENTIALS_H</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#define GRPCXX_SECURITY_CREDENTIALS_H</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div><div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <map></span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <memory></span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div><div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <<a class="code" href="codegen_2grpc__library_8h.html">grpc++/impl/codegen/grpc_library.h</a>></span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <<a class="code" href="security_2auth__context_8h.html">grpc++/security/auth_context.h</a>></span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include <<a class="code" href="grpc_09_09_2support_2status_8h.html">grpc++/support/status.h</a>></span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <<a class="code" href="support_2string__ref_8h.html">grpc++/support/string_ref.h</a>></span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div><div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keyword">struct </span><a class="code" href="grpc__types_8h.html#a122f8f4f0a585396d993d9b55848f222">grpc_call</a>;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div><div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keyword">namespace </span><a class="code" href="namespacegrpc.html">grpc</a> {</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keyword">class </span>ChannelArguments;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keyword">class </span>Channel;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keyword">class </span>SecureChannelCredentials;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keyword">class </span>CallCredentials;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keyword">class </span>SecureCallCredentials;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="classgrpc_1_1_channel_credentials.html">   60</a></span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1_channel_credentials.html">ChannelCredentials</a> : <span class="keyword">private</span> <a class="code" href="classgrpc_1_1_grpc_library_codegen.html">GrpcLibraryCodegen</a> {</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>   <a class="code" href="classgrpc_1_1_channel_credentials.html#a961606a781db020e7dbd100c00b8071b">ChannelCredentials</a>();</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>   <a class="code" href="classgrpc_1_1_channel_credentials.html#ab5e6be85ea4d568ed69c6041e57f5363">~ChannelCredentials</a>();</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span> </div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>   <span class="keyword">friend</span> std::shared_ptr<ChannelCredentials> <a class="code" href="classgrpc_1_1_channel_credentials.html#ab603d68f9c9387554aa756b27b6b7359">CompositeChannelCredentials</a>(</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>       <span class="keyword">const</span> std::shared_ptr<ChannelCredentials>& channel_creds,</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>       <span class="keyword">const</span> std::shared_ptr<CallCredentials>& call_creds);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span> </div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>   <span class="keyword">virtual</span> SecureChannelCredentials* <a class="code" href="classgrpc_1_1_channel_credentials.html#ac32961bb5ef29ba46bddaeb80fafd551">AsSecureCredentials</a>() = 0;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span> </div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>   <span class="keyword">friend</span> std::shared_ptr<Channel> <a class="code" href="classgrpc_1_1_channel_credentials.html#a60689c2f7ac0351dbe8cee57b0a9794d">CreateCustomChannel</a>(</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>       <span class="keyword">const</span> <a class="code" href="namespacegrpc.html#ab04a87625da3bf85cdaf5e7856b00203">grpc::string</a>& target,</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>       <span class="keyword">const</span> std::shared_ptr<ChannelCredentials>& creds,</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>       <span class="keyword">const</span> <a class="code" href="classgrpc_1_1_channel_arguments.html">ChannelArguments</a>& args);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span> </div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>   <span class="keyword">virtual</span> std::shared_ptr<Channel> CreateChannel(</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>       <span class="keyword">const</span> <a class="code" href="namespacegrpc.html#ab04a87625da3bf85cdaf5e7856b00203">grpc::string</a>& target, <span class="keyword">const</span> <a class="code" href="classgrpc_1_1_channel_arguments.html">ChannelArguments</a>& args) = 0;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span> };</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span> </div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="classgrpc_1_1_call_credentials.html">   86</a></span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1_call_credentials.html">CallCredentials</a> : <span class="keyword">private</span> <a class="code" href="classgrpc_1_1_grpc_library_codegen.html">GrpcLibraryCodegen</a> {</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>   <a class="code" href="classgrpc_1_1_call_credentials.html">CallCredentials</a>();</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>   ~<a class="code" href="classgrpc_1_1_call_credentials.html">CallCredentials</a>();</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span> </div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> ApplyToCall(<a class="code" href="grpc__types_8h.html#a122f8f4f0a585396d993d9b55848f222">grpc_call</a>* call) = 0;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span> </div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>   <span class="keyword">friend</span> std::shared_ptr<ChannelCredentials> <a class="code" href="classgrpc_1_1_channel_credentials.html#ab603d68f9c9387554aa756b27b6b7359">CompositeChannelCredentials</a>(</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>       <span class="keyword">const</span> std::shared_ptr<ChannelCredentials>& channel_creds,</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>       <span class="keyword">const</span> std::shared_ptr<CallCredentials>& call_creds);</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>   <span class="keyword">friend</span> std::shared_ptr<CallCredentials> <a class="code" href="namespacegrpc.html#adc351fe5f823440fd2928a7dc65236f4">CompositeCallCredentials</a>(</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>       <span class="keyword">const</span> std::shared_ptr<CallCredentials>& creds1,</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>       <span class="keyword">const</span> std::shared_ptr<CallCredentials>& creds2);</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span> </div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>   <span class="keyword">virtual</span> SecureCallCredentials* <a class="code" href="classgrpc_1_1_channel_credentials.html#ac32961bb5ef29ba46bddaeb80fafd551">AsSecureCredentials</a>() = 0;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span> };</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span> </div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="structgrpc_1_1_ssl_credentials_options.html">  107</a></span> <span class="keyword">struct </span><a class="code" href="structgrpc_1_1_ssl_credentials_options.html">SslCredentialsOptions</a> {</div><div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="structgrpc_1_1_ssl_credentials_options.html#a0ce1730020e18d04b6af48c88e069869">  113</a></span>   <a class="code" href="namespacegrpc.html#ab04a87625da3bf85cdaf5e7856b00203">grpc::string</a> <a class="code" href="structgrpc_1_1_ssl_credentials_options.html#a0ce1730020e18d04b6af48c88e069869">pem_root_certs</a>;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div><div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="structgrpc_1_1_ssl_credentials_options.html#a5b661f8daf02db7283774e0fb9a8979e">  117</a></span>   <a class="code" href="namespacegrpc.html#ab04a87625da3bf85cdaf5e7856b00203">grpc::string</a> <a class="code" href="structgrpc_1_1_ssl_credentials_options.html#a5b661f8daf02db7283774e0fb9a8979e">pem_private_key</a>;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div><div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="structgrpc_1_1_ssl_credentials_options.html#a01015d8ec7dbf49f2ac3cd21f21d383b">  122</a></span>   <a class="code" href="namespacegrpc.html#ab04a87625da3bf85cdaf5e7856b00203">grpc::string</a> <a class="code" href="structgrpc_1_1_ssl_credentials_options.html#a01015d8ec7dbf49f2ac3cd21f21d383b">pem_cert_chain</a>;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span> };</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div><div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="comment">// Factories for building different types of Credentials The functions may</span></div><div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="comment">// return empty shared_ptr when credentials cannot be created. If a</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="comment">// Credentials pointer is returned, it can still be invalid when used to create</span></div><div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="comment">// a channel. A lame channel will be created then and all rpcs will fail on it.</span></div><div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div><div class="line"><a name="l00136"></a><span class="lineno">  136</span> std::shared_ptr<ChannelCredentials> <a class="code" href="namespacegrpc.html#a6beb3ac70ff94bd2ebbd89b8f21d1f61">GoogleDefaultCredentials</a>();</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span> </div><div class="line"><a name="l00139"></a><span class="lineno">  139</span> std::shared_ptr<ChannelCredentials> <a class="code" href="namespacegrpc.html#a845b0382cdd2c71ba8ca715643c38b94">SslCredentials</a>(</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="keyword">const</span> <a class="code" href="structgrpc_1_1_ssl_credentials_options.html">SslCredentialsOptions</a>& options);</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span> </div><div class="line"><a name="l00148"></a><span class="lineno">  148</span> std::shared_ptr<CallCredentials> <a class="code" href="namespacegrpc.html#ad9eda8fa85bd833730a40697278e9fe6">GoogleComputeEngineCredentials</a>();</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div><div class="line"><a name="l00155"></a><span class="lineno">  155</span> std::shared_ptr<CallCredentials> <a class="code" href="namespacegrpc.html#ae61aff892e1d17234d2d2367a5bc72a1">ServiceAccountJWTAccessCredentials</a>(</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="keyword">const</span> <a class="code" href="namespacegrpc.html#ab04a87625da3bf85cdaf5e7856b00203">grpc::string</a>& json_key, <span class="keywordtype">long</span> token_lifetime_seconds);</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span> </div><div class="line"><a name="l00166"></a><span class="lineno">  166</span> std::shared_ptr<CallCredentials> <a class="code" href="namespacegrpc.html#a96901c997b91bc6513b08491e0dca37c">GoogleRefreshTokenCredentials</a>(</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="keyword">const</span> <a class="code" href="namespacegrpc.html#ab04a87625da3bf85cdaf5e7856b00203">grpc::string</a>& json_refresh_token);</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span> </div><div class="line"><a name="l00177"></a><span class="lineno">  177</span> std::shared_ptr<CallCredentials> <a class="code" href="namespacegrpc.html#ad3a80da696ffdaea943f0f858d7a360d">AccessTokenCredentials</a>(</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keyword">const</span> <a class="code" href="namespacegrpc.html#ab04a87625da3bf85cdaf5e7856b00203">grpc::string</a>& access_token);</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span> </div><div class="line"><a name="l00186"></a><span class="lineno">  186</span> std::shared_ptr<CallCredentials> <a class="code" href="namespacegrpc.html#a9fc1fc101b41e680d47028166e76f9d0">GoogleIAMCredentials</a>(</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <span class="keyword">const</span> <a class="code" href="namespacegrpc.html#ab04a87625da3bf85cdaf5e7856b00203">grpc::string</a>& authorization_token,</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="keyword">const</span> <a class="code" href="namespacegrpc.html#ab04a87625da3bf85cdaf5e7856b00203">grpc::string</a>& authority_selector);</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div><div class="line"><a name="l00192"></a><span class="lineno">  192</span> std::shared_ptr<ChannelCredentials> <a class="code" href="classgrpc_1_1_channel_credentials.html#ab603d68f9c9387554aa756b27b6b7359">CompositeChannelCredentials</a>(</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="keyword">const</span> std::shared_ptr<ChannelCredentials>& channel_creds,</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>     <span class="keyword">const</span> std::shared_ptr<CallCredentials>& call_creds);</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span> </div><div class="line"><a name="l00197"></a><span class="lineno">  197</span> std::shared_ptr<CallCredentials> <a class="code" href="namespacegrpc.html#adc351fe5f823440fd2928a7dc65236f4">CompositeCallCredentials</a>(</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <span class="keyword">const</span> std::shared_ptr<CallCredentials>& creds1,</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>     <span class="keyword">const</span> std::shared_ptr<CallCredentials>& creds2);</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div><div class="line"><a name="l00202"></a><span class="lineno">  202</span> std::shared_ptr<ChannelCredentials> <a class="code" href="namespacegrpc.html#a72a5e2e0be4aa041cb587bea339589d7">InsecureChannelCredentials</a>();</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div><div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="comment">// User defined metadata credentials.</span></div><div class="line"><a name="l00205"></a><span class="lineno"><a class="line" href="classgrpc_1_1_metadata_credentials_plugin.html">  205</a></span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1_metadata_credentials_plugin.html">MetadataCredentialsPlugin</a> {</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00207"></a><span class="lineno"><a class="line" href="classgrpc_1_1_metadata_credentials_plugin.html#aa0f8c6fc458bf81c3d3384e84ad7059e">  207</a></span>   <span class="keyword">virtual</span> <a class="code" href="classgrpc_1_1_metadata_credentials_plugin.html#aa0f8c6fc458bf81c3d3384e84ad7059e">~MetadataCredentialsPlugin</a>() {}</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span> </div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>   <span class="comment">// If this method returns true, the Process function will be scheduled in</span></div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>   <span class="comment">// a different thread from the one processing the call.</span></div><div class="line"><a name="l00211"></a><span class="lineno"><a class="line" href="classgrpc_1_1_metadata_credentials_plugin.html#ab3515201a954de40b0784647c057a95c">  211</a></span>   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classgrpc_1_1_metadata_credentials_plugin.html#ab3515201a954de40b0784647c057a95c">IsBlocking</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">true</span>; }</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span> </div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>   <span class="comment">// Type of credentials this plugin is implementing.</span></div><div class="line"><a name="l00214"></a><span class="lineno"><a class="line" href="classgrpc_1_1_metadata_credentials_plugin.html#a3b3a43e2ad1343ce57aa677c010ba7f3">  214</a></span>   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classgrpc_1_1_metadata_credentials_plugin.html#a3b3a43e2ad1343ce57aa677c010ba7f3">GetType</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="stringliteral">""</span>; }</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span> </div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>   <span class="comment">// Gets the auth metatada produced by this plugin.</span></div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>   <span class="comment">// The fully qualified method name is:</span></div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>   <span class="comment">// service_url + "/" + method_name.</span></div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>   <span class="comment">// The channel_auth_context contains (among other things), the identity of</span></div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>   <span class="comment">// the server.</span></div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>   <span class="keyword">virtual</span> <a class="code" href="classgrpc_1_1_status.html">Status</a> GetMetadata(</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>       <a class="code" href="classgrpc_1_1string__ref.html">grpc::string_ref</a> service_url, <a class="code" href="classgrpc_1_1string__ref.html">grpc::string_ref</a> method_name,</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>       <span class="keyword">const</span> <a class="code" href="classgrpc_1_1_auth_context.html">AuthContext</a>& channel_auth_context,</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>       std::multimap<grpc::string, grpc::string>* metadata) = 0;</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span> };</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span> </div><div class="line"><a name="l00227"></a><span class="lineno">  227</span> std::shared_ptr<CallCredentials> <a class="code" href="namespacegrpc.html#a823c6a4b19ffc71fb33e90154ee2ad07">MetadataCredentialsFromPlugin</a>(</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>     std::unique_ptr<MetadataCredentialsPlugin> plugin);</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span> </div><div class="line"><a name="l00230"></a><span class="lineno">  230</span> }  <span class="comment">// namespace grpc</span></div><div class="line"><a name="l00231"></a><span class="lineno">  231</span> </div><div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="preprocessor">#endif  // GRPCXX_SECURITY_CREDENTIALS_H</span></div><div class="ttc" id="grpc__types_8h_html_a122f8f4f0a585396d993d9b55848f222"><div class="ttname"><a href="grpc__types_8h.html#a122f8f4f0a585396d993d9b55848f222">grpc_call</a></div><div class="ttdeci">struct grpc_call grpc_call</div><div class="ttdoc">A Call represents an RPC. </div><div class="ttdef"><b>Definition:</b> grpc_types.h:62</div></div><div class="ttc" id="namespacegrpc_html_a72a5e2e0be4aa041cb587bea339589d7"><div class="ttname"><a href="namespacegrpc.html#a72a5e2e0be4aa041cb587bea339589d7">grpc::InsecureChannelCredentials</a></div><div class="ttdeci">std::shared_ptr< ChannelCredentials > InsecureChannelCredentials()</div><div class="ttdoc">Credentials for an unencrypted, unauthenticated channel. </div></div><div class="ttc" id="namespacegrpc_html_ab04a87625da3bf85cdaf5e7856b00203"><div class="ttname"><a href="namespacegrpc.html#ab04a87625da3bf85cdaf5e7856b00203">grpc::string</a></div><div class="ttdeci">std::string string</div><div class="ttdef"><b>Definition:</b> config.h:118</div></div><div class="ttc" id="classgrpc_1_1_channel_credentials_html_ac32961bb5ef29ba46bddaeb80fafd551"><div class="ttname"><a href="classgrpc_1_1_channel_credentials.html#ac32961bb5ef29ba46bddaeb80fafd551">grpc::ChannelCredentials::AsSecureCredentials</a></div><div class="ttdeci">virtual SecureChannelCredentials * AsSecureCredentials()=0</div></div><div class="ttc" id="classgrpc_1_1_channel_credentials_html_ab5e6be85ea4d568ed69c6041e57f5363"><div class="ttname"><a href="classgrpc_1_1_channel_credentials.html#ab5e6be85ea4d568ed69c6041e57f5363">grpc::ChannelCredentials::~ChannelCredentials</a></div><div class="ttdeci">~ChannelCredentials()</div></div><div class="ttc" id="classgrpc_1_1_channel_arguments_html"><div class="ttname"><a href="classgrpc_1_1_channel_arguments.html">grpc::ChannelArguments</a></div><div class="ttdoc">Options for channel creation. </div><div class="ttdef"><b>Definition:</b> channel_arguments.h:52</div></div><div class="ttc" id="classgrpc_1_1_auth_context_html"><div class="ttname"><a href="classgrpc_1_1_auth_context.html">grpc::AuthContext</a></div><div class="ttdoc">Class encapsulating the Authentication Information. </div><div class="ttdef"><b>Definition:</b> auth_context.h:80</div></div><div class="ttc" id="namespacegrpc_html_ad9eda8fa85bd833730a40697278e9fe6"><div class="ttname"><a href="namespacegrpc.html#ad9eda8fa85bd833730a40697278e9fe6">grpc::GoogleComputeEngineCredentials</a></div><div class="ttdeci">std::shared_ptr< CallCredentials > GoogleComputeEngineCredentials()</div><div class="ttdoc">Builds credentials for use when running in GCE. </div></div><div class="ttc" id="support_2string__ref_8h_html"><div class="ttname"><a href="support_2string__ref_8h.html">string_ref.h</a></div></div><div class="ttc" id="classgrpc_1_1_metadata_credentials_plugin_html_ab3515201a954de40b0784647c057a95c"><div class="ttname"><a href="classgrpc_1_1_metadata_credentials_plugin.html#ab3515201a954de40b0784647c057a95c">grpc::MetadataCredentialsPlugin::IsBlocking</a></div><div class="ttdeci">virtual bool IsBlocking() const </div><div class="ttdef"><b>Definition:</b> credentials.h:211</div></div><div class="ttc" id="namespacegrpc_html_adc351fe5f823440fd2928a7dc65236f4"><div class="ttname"><a href="namespacegrpc.html#adc351fe5f823440fd2928a7dc65236f4">grpc::CompositeCallCredentials</a></div><div class="ttdeci">std::shared_ptr< CallCredentials > CompositeCallCredentials(const std::shared_ptr< CallCredentials > &creds1, const std::shared_ptr< CallCredentials > &creds2)</div><div class="ttdoc">Combines two call credentials objects into a composite call credentials. </div></div><div class="ttc" id="namespacegrpc_html_a96901c997b91bc6513b08491e0dca37c"><div class="ttname"><a href="namespacegrpc.html#a96901c997b91bc6513b08491e0dca37c">grpc::GoogleRefreshTokenCredentials</a></div><div class="ttdeci">std::shared_ptr< CallCredentials > GoogleRefreshTokenCredentials(const grpc::string &json_refresh_token)</div><div class="ttdoc">Builds refresh token credentials. </div></div><div class="ttc" id="classgrpc_1_1_grpc_library_codegen_html"><div class="ttname"><a href="classgrpc_1_1_grpc_library_codegen.html">grpc::GrpcLibraryCodegen</a></div><div class="ttdoc">Classes that require gRPC to be initialized should inherit from this class. </div><div class="ttdef"><b>Definition:</b> grpc_library.h:53</div></div><div class="ttc" id="classgrpc_1_1_channel_credentials_html_a60689c2f7ac0351dbe8cee57b0a9794d"><div class="ttname"><a href="classgrpc_1_1_channel_credentials.html#a60689c2f7ac0351dbe8cee57b0a9794d">grpc::ChannelCredentials::CreateCustomChannel</a></div><div class="ttdeci">friend std::shared_ptr< Channel > CreateCustomChannel(const grpc::string &target, const std::shared_ptr< ChannelCredentials > &creds, const ChannelArguments &args)</div><div class="ttdoc">Create a new custom Channel pointing to target. </div></div><div class="ttc" id="classgrpc_1_1_channel_credentials_html_ab603d68f9c9387554aa756b27b6b7359"><div class="ttname"><a href="classgrpc_1_1_channel_credentials.html#ab603d68f9c9387554aa756b27b6b7359">grpc::ChannelCredentials::CompositeChannelCredentials</a></div><div class="ttdeci">friend std::shared_ptr< ChannelCredentials > CompositeChannelCredentials(const std::shared_ptr< ChannelCredentials > &channel_creds, const std::shared_ptr< CallCredentials > &call_creds)</div><div class="ttdoc">Combines a channel credentials and a call credentials into a composite channel credentials. </div></div><div class="ttc" id="namespacegrpc_html_a845b0382cdd2c71ba8ca715643c38b94"><div class="ttname"><a href="namespacegrpc.html#a845b0382cdd2c71ba8ca715643c38b94">grpc::SslCredentials</a></div><div class="ttdeci">std::shared_ptr< ChannelCredentials > SslCredentials(const SslCredentialsOptions &options)</div><div class="ttdoc">Builds SSL Credentials given SSL specific options. </div></div><div class="ttc" id="classgrpc_1_1_metadata_credentials_plugin_html"><div class="ttname"><a href="classgrpc_1_1_metadata_credentials_plugin.html">grpc::MetadataCredentialsPlugin</a></div><div class="ttdef"><b>Definition:</b> credentials.h:205</div></div><div class="ttc" id="codegen_2grpc__library_8h_html"><div class="ttname"><a href="codegen_2grpc__library_8h.html">grpc_library.h</a></div></div><div class="ttc" id="structgrpc_1_1_ssl_credentials_options_html_a0ce1730020e18d04b6af48c88e069869"><div class="ttname"><a href="structgrpc_1_1_ssl_credentials_options.html#a0ce1730020e18d04b6af48c88e069869">grpc::SslCredentialsOptions::pem_root_certs</a></div><div class="ttdeci">grpc::string pem_root_certs</div><div class="ttdoc">The buffer containing the PEM encoding of the server root certificates. </div><div class="ttdef"><b>Definition:</b> credentials.h:113</div></div><div class="ttc" id="structgrpc_1_1_ssl_credentials_options_html"><div class="ttname"><a href="structgrpc_1_1_ssl_credentials_options.html">grpc::SslCredentialsOptions</a></div><div class="ttdoc">Options used to build SslCredentials. </div><div class="ttdef"><b>Definition:</b> credentials.h:107</div></div><div class="ttc" id="structgrpc_1_1_ssl_credentials_options_html_a01015d8ec7dbf49f2ac3cd21f21d383b"><div class="ttname"><a href="structgrpc_1_1_ssl_credentials_options.html#a01015d8ec7dbf49f2ac3cd21f21d383b">grpc::SslCredentialsOptions::pem_cert_chain</a></div><div class="ttdeci">grpc::string pem_cert_chain</div><div class="ttdoc">The buffer containing the PEM encoding of the client&#39;s certificate chain. </div><div class="ttdef"><b>Definition:</b> credentials.h:122</div></div><div class="ttc" id="namespacegrpc_html"><div class="ttname"><a href="namespacegrpc.html">grpc</a></div><div class="ttdef"><b>Definition:</b> alarm.h:48</div></div><div class="ttc" id="structgrpc_1_1_ssl_credentials_options_html_a5b661f8daf02db7283774e0fb9a8979e"><div class="ttname"><a href="structgrpc_1_1_ssl_credentials_options.html#a5b661f8daf02db7283774e0fb9a8979e">grpc::SslCredentialsOptions::pem_private_key</a></div><div class="ttdeci">grpc::string pem_private_key</div><div class="ttdoc">The buffer containing the PEM encoding of the client&#39;s private key. </div><div class="ttdef"><b>Definition:</b> credentials.h:117</div></div><div class="ttc" id="classgrpc_1_1string__ref_html"><div class="ttname"><a href="classgrpc_1_1string__ref.html">grpc::string_ref</a></div><div class="ttdoc">This class is a non owning reference to a string. </div><div class="ttdef"><b>Definition:</b> string_ref.h:56</div></div><div class="ttc" id="classgrpc_1_1_metadata_credentials_plugin_html_a3b3a43e2ad1343ce57aa677c010ba7f3"><div class="ttname"><a href="classgrpc_1_1_metadata_credentials_plugin.html#a3b3a43e2ad1343ce57aa677c010ba7f3">grpc::MetadataCredentialsPlugin::GetType</a></div><div class="ttdeci">virtual const char * GetType() const </div><div class="ttdef"><b>Definition:</b> credentials.h:214</div></div><div class="ttc" id="namespacegrpc_html_ae61aff892e1d17234d2d2367a5bc72a1"><div class="ttname"><a href="namespacegrpc.html#ae61aff892e1d17234d2d2367a5bc72a1">grpc::ServiceAccountJWTAccessCredentials</a></div><div class="ttdeci">std::shared_ptr< CallCredentials > ServiceAccountJWTAccessCredentials(const grpc::string &json_key, long token_lifetime_seconds)</div><div class="ttdoc">Builds Service Account JWT Access credentials. </div></div><div class="ttc" id="classgrpc_1_1_channel_credentials_html"><div class="ttname"><a href="classgrpc_1_1_channel_credentials.html">grpc::ChannelCredentials</a></div><div class="ttdoc">A channel credentials object encapsulates all the state needed by a client to authenticate with a ser...</div><div class="ttdef"><b>Definition:</b> credentials.h:60</div></div><div class="ttc" id="classgrpc_1_1_status_html"><div class="ttname"><a href="classgrpc_1_1_status.html">grpc::Status</a></div><div class="ttdoc">Did it work? If it didn&#39;t, why? </div><div class="ttdef"><b>Definition:</b> status.h:45</div></div><div class="ttc" id="namespacegrpc_html_a9fc1fc101b41e680d47028166e76f9d0"><div class="ttname"><a href="namespacegrpc.html#a9fc1fc101b41e680d47028166e76f9d0">grpc::GoogleIAMCredentials</a></div><div class="ttdeci">std::shared_ptr< CallCredentials > GoogleIAMCredentials(const grpc::string &authorization_token, const grpc::string &authority_selector)</div><div class="ttdoc">Builds IAM credentials. </div></div><div class="ttc" id="classgrpc_1_1_call_credentials_html"><div class="ttname"><a href="classgrpc_1_1_call_credentials.html">grpc::CallCredentials</a></div><div class="ttdoc">A call credentials object encapsulates the state needed by a client to authenticate with a server for...</div><div class="ttdef"><b>Definition:</b> credentials.h:86</div></div><div class="ttc" id="namespacegrpc_html_a6beb3ac70ff94bd2ebbd89b8f21d1f61"><div class="ttname"><a href="namespacegrpc.html#a6beb3ac70ff94bd2ebbd89b8f21d1f61">grpc::GoogleDefaultCredentials</a></div><div class="ttdeci">std::shared_ptr< ChannelCredentials > GoogleDefaultCredentials()</div><div class="ttdoc">Builds credentials with reasonable defaults. </div></div><div class="ttc" id="grpc_09_09_2support_2status_8h_html"><div class="ttname"><a href="grpc_09_09_2support_2status_8h.html">status.h</a></div></div><div class="ttc" id="namespacegrpc_html_a823c6a4b19ffc71fb33e90154ee2ad07"><div class="ttname"><a href="namespacegrpc.html#a823c6a4b19ffc71fb33e90154ee2ad07">grpc::MetadataCredentialsFromPlugin</a></div><div class="ttdeci">std::shared_ptr< CallCredentials > MetadataCredentialsFromPlugin(std::unique_ptr< MetadataCredentialsPlugin > plugin)</div></div><div class="ttc" id="namespacegrpc_html_ad3a80da696ffdaea943f0f858d7a360d"><div class="ttname"><a href="namespacegrpc.html#ad3a80da696ffdaea943f0f858d7a360d">grpc::AccessTokenCredentials</a></div><div class="ttdeci">std::shared_ptr< CallCredentials > AccessTokenCredentials(const grpc::string &access_token)</div><div class="ttdoc">Builds access token credentials. </div></div><div class="ttc" id="classgrpc_1_1_metadata_credentials_plugin_html_aa0f8c6fc458bf81c3d3384e84ad7059e"><div class="ttname"><a href="classgrpc_1_1_metadata_credentials_plugin.html#aa0f8c6fc458bf81c3d3384e84ad7059e">grpc::MetadataCredentialsPlugin::~MetadataCredentialsPlugin</a></div><div class="ttdeci">virtual ~MetadataCredentialsPlugin()</div><div class="ttdef"><b>Definition:</b> credentials.h:207</div></div><div class="ttc" id="classgrpc_1_1_channel_credentials_html_a961606a781db020e7dbd100c00b8071b"><div class="ttname"><a href="classgrpc_1_1_channel_credentials.html#a961606a781db020e7dbd100c00b8071b">grpc::ChannelCredentials::ChannelCredentials</a></div><div class="ttdeci">ChannelCredentials()</div></div><div class="ttc" id="security_2auth__context_8h_html"><div class="ttname"><a href="security_2auth__context_8h.html">auth_context.h</a></div></div></div><!-- fragment --></div><!-- contents --><!-- start footer part --><hr class="footer"/><address class="footer"><small>Generated on Thu Aug 18 2016 21:34:58 for GRPC C++ by  <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11</small></address></body></html>
 |