116 lines
4.8 KiB
HTML
Executable File
116 lines
4.8 KiB
HTML
Executable File
<?xml version="1.0" ?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>PKCS12_create</title>
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
<link rev="made" href="mailto:root@localhost" />
|
|
</head>
|
|
|
|
<body style="background-color: white">
|
|
|
|
|
|
<!-- INDEX BEGIN -->
|
|
<div name="index">
|
|
<p><a name="__index__"></a></p>
|
|
|
|
<ul>
|
|
|
|
<li><a href="#name">NAME</a></li>
|
|
<li><a href="#synopsis">SYNOPSIS</a></li>
|
|
<li><a href="#description">DESCRIPTION</a></li>
|
|
<li><a href="#notes">NOTES</a></li>
|
|
<li><a href="#return_values">RETURN VALUES</a></li>
|
|
<li><a href="#see_also">SEE ALSO</a></li>
|
|
<li><a href="#copyright">COPYRIGHT</a></li>
|
|
</ul>
|
|
|
|
<hr name="index" />
|
|
</div>
|
|
<!-- INDEX END -->
|
|
|
|
<p>
|
|
</p>
|
|
<hr />
|
|
<h1><a name="name">NAME</a></h1>
|
|
<p>PKCS12_create - create a PKCS#12 structure</p>
|
|
<p>
|
|
</p>
|
|
<hr />
|
|
<h1><a name="synopsis">SYNOPSIS</a></h1>
|
|
<pre>
|
|
#include <openssl/pkcs12.h></pre>
|
|
<pre>
|
|
PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey,
|
|
X509 *cert, STACK_OF(X509) *ca,
|
|
int nid_key, int nid_cert, int iter, int mac_iter, int keytype);</pre>
|
|
<p>
|
|
</p>
|
|
<hr />
|
|
<h1><a name="description">DESCRIPTION</a></h1>
|
|
<p>PKCS12_create() creates a PKCS#12 structure.</p>
|
|
<p><strong>pass</strong> is the passphrase to use. <strong>name</strong> is the <strong>friendlyName</strong> to use for
|
|
the supplied certificate and key. <strong>pkey</strong> is the private key to include in
|
|
the structure and <strong>cert</strong> its corresponding certificates. <strong>ca</strong>, if not <strong>NULL</strong>
|
|
is an optional set of certificates to also include in the structure.</p>
|
|
<p><strong>nid_key</strong> and <strong>nid_cert</strong> are the encryption algorithms that should be used
|
|
for the key and certificate respectively. The modes
|
|
GCM, CCM, XTS, and OCB are unsupported. <strong>iter</strong> is the encryption algorithm
|
|
iteration count to use and <strong>mac_iter</strong> is the MAC iteration count to use.
|
|
<strong>keytype</strong> is the type of key.</p>
|
|
<p>
|
|
</p>
|
|
<hr />
|
|
<h1><a name="notes">NOTES</a></h1>
|
|
<p>The parameters <strong>nid_key</strong>, <strong>nid_cert</strong>, <strong>iter</strong>, <strong>mac_iter</strong> and <strong>keytype</strong>
|
|
can all be set to zero and sensible defaults will be used.</p>
|
|
<p>These defaults are: 40 bit RC2 encryption for certificates, triple DES
|
|
encryption for private keys, a key iteration count of PKCS12_DEFAULT_ITER
|
|
(currently 2048) and a MAC iteration count of 1.</p>
|
|
<p>The default MAC iteration count is 1 in order to retain compatibility with
|
|
old software which did not interpret MAC iteration counts. If such compatibility
|
|
is not required then <strong>mac_iter</strong> should be set to PKCS12_DEFAULT_ITER.</p>
|
|
<p><strong>keytype</strong> adds a flag to the store private key. This is a non standard extension
|
|
that is only currently interpreted by MSIE. If set to zero the flag is omitted,
|
|
if set to <strong>KEY_SIG</strong> the key can be used for signing only, if set to <strong>KEY_EX</strong>
|
|
it can be used for signing and encryption. This option was useful for old
|
|
export grade software which could use signing only keys of arbitrary size but
|
|
had restrictions on the permissible sizes of keys which could be used for
|
|
encryption.</p>
|
|
<p>If a certificate contains an <strong>alias</strong> or <strong>keyid</strong> then this will be
|
|
used for the corresponding <strong>friendlyName</strong> or <strong>localKeyID</strong> in the
|
|
PKCS12 structure.</p>
|
|
<p>Either <strong>pkey</strong>, <strong>cert</strong> or both can be <strong>NULL</strong> to indicate that no key or
|
|
certificate is required. In previous versions both had to be present or
|
|
a fatal error is returned.</p>
|
|
<p><strong>nid_key</strong> or <strong>nid_cert</strong> can be set to -1 indicating that no encryption
|
|
should be used.</p>
|
|
<p><strong>mac_iter</strong> can be set to -1 and the MAC will then be omitted entirely.</p>
|
|
<p>PKCS12_create() makes assumptions regarding the encoding of the given pass
|
|
phrase.
|
|
See <em>passphrase-encoding(7)</em> for more information.</p>
|
|
<p>
|
|
</p>
|
|
<hr />
|
|
<h1><a name="return_values">RETURN VALUES</a></h1>
|
|
<p>PKCS12_create() returns a valid <strong>PKCS12</strong> structure or NULL if an error occurred.</p>
|
|
<p>
|
|
</p>
|
|
<hr />
|
|
<h1><a name="see_also">SEE ALSO</a></h1>
|
|
<p><em>d2i_PKCS12(3)</em>,
|
|
<em>passphrase-encoding(7)</em></p>
|
|
<p>
|
|
</p>
|
|
<hr />
|
|
<h1><a name="copyright">COPYRIGHT</a></h1>
|
|
<p>Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.</p>
|
|
<p>Licensed under the Apache License 2.0 (the "License"). You may not use
|
|
this file except in compliance with the License. You can obtain a copy
|
|
in the file LICENSE in the source distribution or at
|
|
<a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p>
|
|
|
|
</body>
|
|
|
|
</html>
|