1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-->
<refentry id="fn_xenc_key_create_cert">
<refmeta>
<refentrytitle>xenc_key_create_cert</refentrytitle>
<refmiscinfo>hash</refmiscinfo>
</refmeta>
<refnamediv>
<refname>xenc_key_create_cert</refname>
<refpurpose>Import a key from a certificate</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_xenc_key_create_cert">
<funcprototype id="fproto_xenc_key_create_cert">
<funcdef><function>xenc_key_create_cert</function></funcdef>
<paramdef>in <parameter>name</parameter> varchar</paramdef>
<paramdef>in <parameter>cert</parameter> varchar</paramdef>
<paramdef>in <parameter>type</parameter> varchar</paramdef>
<paramdef>in <parameter>fmt </parameter> int</paramdef>
<paramdef>in <parameter>pkey</parameter> varchar</paramdef>
<paramdef>in <parameter>pass</parameter> varchar</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc_xenc_key_create_cert">
<title>Description</title>
<para>
The function is used to import a key (usually an asymmetric key like RSA or DSA)
into user's space from a certificate.
</para>
</refsect1>
<refsect1 id="params_xenc_key_create_cert">
<title>Parameters</title>
<refsect2><title>name</title>
<para>The name of the key to be registered</para>
</refsect2>
<refsect2><title>cert</title>
<para>String containing the certificate</para>
</refsect2>
<refsect2><title>type</title>
<para>'X.509' is only supported value</para>
</refsect2>
<refsect2><title>fmt</title>
<para>The input format of the certificate: 3 - "DER", 1 - "PEM" or 2 - "PKCS#12".
</para>
</refsect2>
<refsect2><title>pkey</title>
<para>When an X.509 certificate is imported, this can be supplied to load
the corresponding private key also. This is optional. Note that when
the PKCS#12 format is used to import an X.509 certificate, the private
key is in the 'cert', hence this parameter in such case must be
omitted.
</para>
</refsect2>
<refsect2><title>pass</title>
<para>The password to unlock the private key. If not required this can be NULL
to indicate no password is needed.</para>
</refsect2>
</refsect1>
<refsect1 id="examples_xenc_key_create_cert">
<title>Examples</title>
<example id="ex_xenc_key_create_cert"><title>Importing a key from X.509 certificate</title>
<screen><![CDATA[
...
xenc_key_create_cert ('myRSA', file_to_string ('keys/mycert.pfx'), 'X.509', 2, NULL, 'secret');
xenc_set_primary_key ('myRSA');
...
]]>
</screen>
</example>
</refsect1>
<refsect1 id="seealso_xenc_key_create_cert">
<title>See Also</title>
<para><link linkend="fn_xenc_set_primary_key"><function>xenc_set_primary_key()</function></link></para>
<para><link linkend="fn_xenc_key_3DES_create"><function>xenc_key_3DES_create()</function></link></para>
<para><link linkend="fn_xenc_key_3DES_rand_create"><function>xenc_key_3des_rand_create()</function></link></para>
<para><link linkend="fn_xenc_key_AES_create"><function>xenc_key_aes_create()</function></link></para>
<para><link linkend="fn_xenc_key_3DES_read"><function>xenc_key_3DES_read()</function></link></para>
<para><link linkend="fn_xenc_key_DSA_read"><function>xenc_key_DSA_read()</function></link></para>
<para><link linkend="fn_xenc_key_DSA_create"><function>xenc_key_dsa_create()</function></link></para>
<para><link linkend="fn_xenc_key_RSA_read"><function>xenc_key_RSA_read()</function></link></para>
<para><link linkend="fn_xenc_key_serialize"><function>xenc_key_serialize()</function></link></para>
<para><link linkend="fn_xenc_key_remove"><function>xenc_key_remove()</function></link></para>
</refsect1>
</refentry>
|