<!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.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>José: /home/nmccallu/Projects/jose/jose/jwe.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>
<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">José
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<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)">
</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_f2bd36b8a3f3d476e48bdb5015c9fdfb.html">jose</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">jwe.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* vim: set tabstop=8 shiftwidth=4 softtabstop=4 expandtab smarttab colorcolumn=80: */</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Copyright 2016 Red Hat, Inc.</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> *     http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;<span class="preprocessor">#include &quot;cfg.h&quot;</span></div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="preprocessor">#include &quot;io.h&quot;</span></div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="preprocessor">#include &lt;jansson.h&gt;</span></div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="preprocessor">#include &lt;stdbool.h&gt;</span></div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;json_t *</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;<a class="code" href="group__jose__jwe.html#ga5920b450d6f4b0aa1729a7230a48fb32">jose_jwe_hdr</a>(<span class="keyword">const</span> json_t *jwe, <span class="keyword">const</span> json_t *rcp);</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;<span class="keywordtype">bool</span></div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<a class="code" href="group__jose__jwe.html#ga67fd2b695bfff58a3b7adaf6bce9a773">jose_jwe_enc</a>(jose_cfg_t *cfg, json_t *jwe, json_t *rcp, <span class="keyword">const</span> json_t *jwk,</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;             <span class="keyword">const</span> <span class="keywordtype">void</span> *pt, <span class="keywordtype">size_t</span> ptl);</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<a class="code" href="structjose__io__t.html">jose_io_t</a> *</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;<a class="code" href="group__jose__jwe.html#ga27e44e2144dc81b778158163661b7f9f">jose_jwe_enc_io</a>(jose_cfg_t *cfg, json_t *jwe, json_t *rcp, <span class="keyword">const</span> json_t *jwk,</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;                <a class="code" href="structjose__io__t.html">jose_io_t</a> *next);</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;<span class="keywordtype">bool</span></div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;<a class="code" href="group__jose__jwe.html#ga6cebc627dea8bb944d35acb776abe769">jose_jwe_enc_jwk</a>(jose_cfg_t *cfg, json_t *jwe, json_t *rcp, <span class="keyword">const</span> json_t *jwk,</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;                 json_t *cek);</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;<span class="keywordtype">bool</span></div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;<a class="code" href="group__jose__jwe.html#ga885caaa8a0f24bcbdf283478b26b614d">jose_jwe_enc_cek</a>(jose_cfg_t *cfg, json_t *jwe, <span class="keyword">const</span> json_t *cek,</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;                 <span class="keyword">const</span> <span class="keywordtype">void</span> *pt, <span class="keywordtype">size_t</span> ptl);</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;</div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;<a class="code" href="structjose__io__t.html">jose_io_t</a> *</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;<a class="code" href="group__jose__jwe.html#gae484a56237a35f5c18038a1b24952f0a">jose_jwe_enc_cek_io</a>(jose_cfg_t *cfg, json_t *jwe, <span class="keyword">const</span> json_t *cek,</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;                    <a class="code" href="structjose__io__t.html">jose_io_t</a> *next);</div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;</div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;<span class="keywordtype">void</span> *</div><div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;<a class="code" href="group__jose__jwe.html#gac873b95e6fad75e2d517970a94346c5d">jose_jwe_dec</a>(jose_cfg_t *cfg, <span class="keyword">const</span> json_t *jwe, <span class="keyword">const</span> json_t *rcp,</div><div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;             <span class="keyword">const</span> json_t *jwk, <span class="keywordtype">size_t</span> *ptl);</div><div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;</div><div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;<a class="code" href="structjose__io__t.html">jose_io_t</a> *</div><div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;<a class="code" href="group__jose__jwe.html#gacd3c7703b57c524bc2683f2c0d0db4b8">jose_jwe_dec_io</a>(jose_cfg_t *cfg, <span class="keyword">const</span> json_t *jwe, <span class="keyword">const</span> json_t *rcp,</div><div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;                <span class="keyword">const</span> json_t *jwk, <a class="code" href="structjose__io__t.html">jose_io_t</a> *next);</div><div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;</div><div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;json_t *</div><div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;<a class="code" href="group__jose__jwe.html#gab9608cf23da17fadce6078aa2d862608">jose_jwe_dec_jwk</a>(jose_cfg_t *cfg, <span class="keyword">const</span> json_t *jwe, <span class="keyword">const</span> json_t *rcp,</div><div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;                 <span class="keyword">const</span> json_t *jwk);</div><div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;</div><div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;<span class="keywordtype">void</span> *</div><div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;<a class="code" href="group__jose__jwe.html#ga64b1b6074f8643aa301007fc125aed59">jose_jwe_dec_cek</a>(jose_cfg_t *cfg, <span class="keyword">const</span> json_t *jwe, <span class="keyword">const</span> json_t *cek,</div><div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;                 <span class="keywordtype">size_t</span> *ptl);</div><div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;</div><div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;<a class="code" href="structjose__io__t.html">jose_io_t</a> *</div><div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;<a class="code" href="group__jose__jwe.html#gaf22bbcd02627f938be28fa4b1778e29c">jose_jwe_dec_cek_io</a>(jose_cfg_t *cfg, <span class="keyword">const</span> json_t *jwe, <span class="keyword">const</span> json_t *cek,</div><div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;                    <a class="code" href="structjose__io__t.html">jose_io_t</a> *next);</div><div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;</div><div class="ttc" id="group__jose__jwe_html_gacd3c7703b57c524bc2683f2c0d0db4b8"><div class="ttname"><a href="group__jose__jwe.html#gacd3c7703b57c524bc2683f2c0d0db4b8">jose_jwe_dec_io</a></div><div class="ttdeci">jose_io_t * jose_jwe_dec_io(jose_cfg_t *cfg, const json_t *jwe, const json_t *rcp, const json_t *jwk, jose_io_t *next)</div><div class="ttdoc">Unwraps and decrypts ciphertext using streaming. </div></div>
<div class="ttc" id="group__jose__jwe_html_gab9608cf23da17fadce6078aa2d862608"><div class="ttname"><a href="group__jose__jwe.html#gab9608cf23da17fadce6078aa2d862608">jose_jwe_dec_jwk</a></div><div class="ttdeci">json_t * jose_jwe_dec_jwk(jose_cfg_t *cfg, const json_t *jwe, const json_t *rcp, const json_t *jwk)</div><div class="ttdoc">Unwraps a CEK with a JWK. </div></div>
<div class="ttc" id="group__jose__jwe_html_gac873b95e6fad75e2d517970a94346c5d"><div class="ttname"><a href="group__jose__jwe.html#gac873b95e6fad75e2d517970a94346c5d">jose_jwe_dec</a></div><div class="ttdeci">void * jose_jwe_dec(jose_cfg_t *cfg, const json_t *jwe, const json_t *rcp, const json_t *jwk, size_t *ptl)</div><div class="ttdoc">Unwraps and decrypts ciphertext. </div></div>
<div class="ttc" id="group__jose__jwe_html_ga885caaa8a0f24bcbdf283478b26b614d"><div class="ttname"><a href="group__jose__jwe.html#ga885caaa8a0f24bcbdf283478b26b614d">jose_jwe_enc_cek</a></div><div class="ttdeci">bool jose_jwe_enc_cek(jose_cfg_t *cfg, json_t *jwe, const json_t *cek, const void *pt, size_t ptl)</div><div class="ttdoc">Encrypts plaintext with the CEK. </div></div>
<div class="ttc" id="group__jose__jwe_html_ga67fd2b695bfff58a3b7adaf6bce9a773"><div class="ttname"><a href="group__jose__jwe.html#ga67fd2b695bfff58a3b7adaf6bce9a773">jose_jwe_enc</a></div><div class="ttdeci">bool jose_jwe_enc(jose_cfg_t *cfg, json_t *jwe, json_t *rcp, const json_t *jwk, const void *pt, size_t ptl)</div><div class="ttdoc">Wraps and encrypts plaintext. </div></div>
<div class="ttc" id="structjose__io__t_html"><div class="ttname"><a href="structjose__io__t.html">jose_io_t</a></div><div class="ttdoc">The interface for chained IO. </div><div class="ttdef"><b>Definition:</b> io.h:61</div></div>
<div class="ttc" id="group__jose__jwe_html_gae484a56237a35f5c18038a1b24952f0a"><div class="ttname"><a href="group__jose__jwe.html#gae484a56237a35f5c18038a1b24952f0a">jose_jwe_enc_cek_io</a></div><div class="ttdeci">jose_io_t * jose_jwe_enc_cek_io(jose_cfg_t *cfg, json_t *jwe, const json_t *cek, jose_io_t *next)</div><div class="ttdoc">Encrypts plaintext with the CEK using streaming. </div></div>
<div class="ttc" id="group__jose__jwe_html_gaf22bbcd02627f938be28fa4b1778e29c"><div class="ttname"><a href="group__jose__jwe.html#gaf22bbcd02627f938be28fa4b1778e29c">jose_jwe_dec_cek_io</a></div><div class="ttdeci">jose_io_t * jose_jwe_dec_cek_io(jose_cfg_t *cfg, const json_t *jwe, const json_t *cek, jose_io_t *next)</div><div class="ttdoc">Decrypts ciphertext with the CEK using streaming. </div></div>
<div class="ttc" id="group__jose__jwe_html_ga64b1b6074f8643aa301007fc125aed59"><div class="ttname"><a href="group__jose__jwe.html#ga64b1b6074f8643aa301007fc125aed59">jose_jwe_dec_cek</a></div><div class="ttdeci">void * jose_jwe_dec_cek(jose_cfg_t *cfg, const json_t *jwe, const json_t *cek, size_t *ptl)</div><div class="ttdoc">Decrypts ciphertext with the CEK. </div></div>
<div class="ttc" id="group__jose__jwe_html_ga27e44e2144dc81b778158163661b7f9f"><div class="ttname"><a href="group__jose__jwe.html#ga27e44e2144dc81b778158163661b7f9f">jose_jwe_enc_io</a></div><div class="ttdeci">jose_io_t * jose_jwe_enc_io(jose_cfg_t *cfg, json_t *jwe, json_t *rcp, const json_t *jwk, jose_io_t *next)</div><div class="ttdoc">Wraps and encrypts plaintext using streaming. </div></div>
<div class="ttc" id="group__jose__jwe_html_ga6cebc627dea8bb944d35acb776abe769"><div class="ttname"><a href="group__jose__jwe.html#ga6cebc627dea8bb944d35acb776abe769">jose_jwe_enc_jwk</a></div><div class="ttdeci">bool jose_jwe_enc_jwk(jose_cfg_t *cfg, json_t *jwe, json_t *rcp, const json_t *jwk, json_t *cek)</div><div class="ttdoc">Wraps a CEK with a JWK. </div></div>
<div class="ttc" id="group__jose__jwe_html_ga5920b450d6f4b0aa1729a7230a48fb32"><div class="ttname"><a href="group__jose__jwe.html#ga5920b450d6f4b0aa1729a7230a48fb32">jose_jwe_hdr</a></div><div class="ttdeci">json_t * jose_jwe_hdr(const json_t *jwe, const json_t *rcp)</div><div class="ttdoc">Merges the JOSE headers of a JWE object and a JWE recpient object. </div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>