<!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>mbed TLS v2.7.3: pkcs12.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="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">mbed TLS v2.7.3 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',false,false,'search.php','Search'); }); </script> <div id="main-nav"></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_b4d146e9a6d8dd56ed4afb2480a97fd3.html">mbedtls</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">pkcs12.h</div> </div> </div><!--header--> <div class="contents"> <a href="pkcs12_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> </div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">/*</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * SPDX-License-Identifier: Apache-2.0</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"> * Licensed under the Apache License, Version 2.0 (the "License"); you may</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * not use this file except in compliance with the License.</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> *</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> *</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> * This file is part of mbed TLS (https://tls.mbed.org)</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> */</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#ifndef MBEDTLS_PKCS12_H</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#define MBEDTLS_PKCS12_H</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "<a class="code" href="md_8h.html">md.h</a>"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "<a class="code" href="cipher_8h.html">cipher.h</a>"</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "<a class="code" href="asn1_8h.html">asn1.h</a>"</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include <stddef.h></span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="pkcs12_8h.html#ac856f81d3cbc3baeaa848b33d991209b"> 33</a></span> <span class="preprocessor">#define MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA -0x1F80 </span></div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="pkcs12_8h.html#ae887e38a4caab392fc5086bcceed7af9"> 34</a></span> <span class="preprocessor">#define MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE -0x1F00 </span></div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="pkcs12_8h.html#a92e9101410d452e508c88a7231e23996"> 35</a></span> <span class="preprocessor">#define MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT -0x1E80 </span></div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="pkcs12_8h.html#ab3313f9e7321d23b3af93e97a544ffdb"> 36</a></span> <span class="preprocessor">#define MBEDTLS_ERR_PKCS12_PASSWORD_MISMATCH -0x1E00 </span></div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="pkcs12_8h.html#ad9b0f41c74cd6a8e072c84b5d310b331"> 38</a></span> <span class="preprocessor">#define MBEDTLS_PKCS12_DERIVE_KEY 1 </span></div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="pkcs12_8h.html#ad8ac9a220c8d237a9a5bc972daed1c13"> 39</a></span> <span class="preprocessor">#define MBEDTLS_PKCS12_DERIVE_IV 2 </span></div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="pkcs12_8h.html#a91d3d19fb1a5cd18648f363eff8617ec"> 40</a></span> <span class="preprocessor">#define MBEDTLS_PKCS12_DERIVE_MAC_KEY 3 </span></div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="pkcs12_8h.html#a41364d57177059b3ffb3167139e741b4"> 42</a></span> <span class="preprocessor">#define MBEDTLS_PKCS12_PBE_DECRYPT 0</span></div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="pkcs12_8h.html#ae833899c432600a15030b761d1e34d44"> 43</a></span> <span class="preprocessor">#define MBEDTLS_PKCS12_PBE_ENCRYPT 1</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="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">extern</span> <span class="stringliteral">"C"</span> {</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="keywordtype">int</span> <a class="code" href="pkcs12_8h.html#af865b866a1e1b6f5513f5904f1fdf2fa">mbedtls_pkcs12_pbe_sha1_rc4_128</a>( <a class="code" href="structmbedtls__asn1__buf.html">mbedtls_asn1_buf</a> *pbe_params, <span class="keywordtype">int</span> mode,</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pwd, <span class="keywordtype">size_t</span> pwdlen,</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *input, <span class="keywordtype">size_t</span> len,</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *output );</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <span class="keywordtype">int</span> <a class="code" href="pkcs12_8h.html#aeca4c569f386fd7ece7fcfb4efc95a29">mbedtls_pkcs12_pbe</a>( <a class="code" href="structmbedtls__asn1__buf.html">mbedtls_asn1_buf</a> *pbe_params, <span class="keywordtype">int</span> mode,</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <a class="code" href="cipher_8h.html#a00c5885f1ea7279c5a7d8e12e596569d">mbedtls_cipher_type_t</a> cipher_type, <a class="code" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296">mbedtls_md_type_t</a> md_type,</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pwd, <span class="keywordtype">size_t</span> pwdlen,</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *input, <span class="keywordtype">size_t</span> len,</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *output );</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="keywordtype">int</span> <a class="code" href="pkcs12_8h.html#a5e58a53e1f2194583f1e48fc2ffef627">mbedtls_pkcs12_derivation</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *data, <span class="keywordtype">size_t</span> datalen,</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pwd, <span class="keywordtype">size_t</span> pwdlen,</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *salt, <span class="keywordtype">size_t</span> saltlen,</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <a class="code" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296">mbedtls_md_type_t</a> <a class="code" href="md_8h.html#a36c5d8bda1905e0434708f0ef5912dda">mbedtls_md</a>, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">int</span> iterations );</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> }</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> </div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="preprocessor">#endif </span><span class="comment">/* pkcs12.h */</span><span class="preprocessor"></span></div><div class="ttc" id="cipher_8h_html_a00c5885f1ea7279c5a7d8e12e596569d"><div class="ttname"><a href="cipher_8h.html#a00c5885f1ea7279c5a7d8e12e596569d">mbedtls_cipher_type_t</a></div><div class="ttdeci">mbedtls_cipher_type_t</div><div class="ttdoc">An enumeration of supported (cipher, mode) pairs. </div><div class="ttdef"><b>Definition:</b> <a href="cipher_8h_source.html#l00096">cipher.h:96</a></div></div> <div class="ttc" id="asn1_8h_html"><div class="ttname"><a href="asn1_8h.html">asn1.h</a></div><div class="ttdoc">Generic ASN.1 parsing. </div></div> <div class="ttc" id="structmbedtls__asn1__buf_html"><div class="ttname"><a href="structmbedtls__asn1__buf.html">mbedtls_asn1_buf</a></div><div class="ttdef"><b>Definition:</b> <a href="asn1_8h_source.html#l00134">asn1.h:134</a></div></div> <div class="ttc" id="pkcs12_8h_html_a5e58a53e1f2194583f1e48fc2ffef627"><div class="ttname"><a href="pkcs12_8h.html#a5e58a53e1f2194583f1e48fc2ffef627">mbedtls_pkcs12_derivation</a></div><div class="ttdeci">int mbedtls_pkcs12_derivation(unsigned char *data, size_t datalen, const unsigned char *pwd, size_t pwdlen, const unsigned char *salt, size_t saltlen, mbedtls_md_type_t mbedtls_md, int id, int iterations)</div><div class="ttdoc">The PKCS#12 derivation function uses a password and a salt to produce pseudo-random bits for a partic...</div></div> <div class="ttc" id="md_8h_html_a36c5d8bda1905e0434708f0ef5912dda"><div class="ttname"><a href="md_8h.html#a36c5d8bda1905e0434708f0ef5912dda">mbedtls_md</a></div><div class="ttdeci">int mbedtls_md(const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen, unsigned char *output)</div><div class="ttdoc">This function calculates the message-digest of a buffer, with respect to a configurable message-diges...</div></div> <div class="ttc" id="cipher_8h_html"><div class="ttname"><a href="cipher_8h.html">cipher.h</a></div><div class="ttdoc">The generic cipher wrapper. </div></div> <div class="ttc" id="md_8h_html"><div class="ttname"><a href="md_8h.html">md.h</a></div><div class="ttdoc">The generic message-digest wrapper. </div></div> <div class="ttc" id="pkcs12_8h_html_af865b866a1e1b6f5513f5904f1fdf2fa"><div class="ttname"><a href="pkcs12_8h.html#af865b866a1e1b6f5513f5904f1fdf2fa">mbedtls_pkcs12_pbe_sha1_rc4_128</a></div><div class="ttdeci">int mbedtls_pkcs12_pbe_sha1_rc4_128(mbedtls_asn1_buf *pbe_params, int mode, const unsigned char *pwd, size_t pwdlen, const unsigned char *input, size_t len, unsigned char *output)</div><div class="ttdoc">PKCS12 Password Based function (encryption / decryption) for pbeWithSHAAnd128BitRC4. </div></div> <div class="ttc" id="pkcs12_8h_html_aeca4c569f386fd7ece7fcfb4efc95a29"><div class="ttname"><a href="pkcs12_8h.html#aeca4c569f386fd7ece7fcfb4efc95a29">mbedtls_pkcs12_pbe</a></div><div class="ttdeci">int mbedtls_pkcs12_pbe(mbedtls_asn1_buf *pbe_params, int mode, mbedtls_cipher_type_t cipher_type, mbedtls_md_type_t md_type, const unsigned char *pwd, size_t pwdlen, const unsigned char *input, size_t len, unsigned char *output)</div><div class="ttdoc">PKCS12 Password Based function (encryption / decryption) for cipher-based and mbedtls_md-based PBE&#39;s...</div></div> <div class="ttc" id="md_8h_html_a219313cb40503ec3e34a857ab98b2296"><div class="ttname"><a href="md_8h.html#a219313cb40503ec3e34a857ab98b2296">mbedtls_md_type_t</a></div><div class="ttdeci">mbedtls_md_type_t</div><div class="ttdoc">Enumeration of supported message digests. </div><div class="ttdef"><b>Definition:</b> <a href="md_8h_source.html#l00056">md.h:56</a></div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue May 8 2018 21:08:41 for mbed TLS v2.7.3 by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.13 </small></address> </body> </html>