Current Path : /usr/opt/openssl11/share/doc/openssl/html/man3/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/opt/openssl11/share/doc/openssl/html/man3/PKCS7_sign_add_signer.html |
<?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>PKCS7_sign_add_signer</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:root@hsxx.drive.ne.jp" /> </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="#history">HISTORY</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>PKCS7_sign_add_signer, PKCS7_add_certificate, PKCS7_add_crl - add information to PKCS7 structure</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> #include <openssl/pkcs7.h></pre> <pre> PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, X509 *signcert, EVP_PKEY *pkey, const EVP_MD *md, int flags); int PKCS7_add_certificate(PKCS7 *p7, X509 *cert); int PKCS7_add_crl(PKCS7 *p7, X509_CRL *crl);</pre> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>PKCS7_sign_add_signer() adds a signer with certificate <em>signcert</em> and private key <em>pkey</em> using message digest <em>md</em> to a PKCS7 signed data structure <em>p7</em>.</p> <p>The <strong>PKCS7</strong> structure should be obtained from an initial call to PKCS7_sign() with the flag <strong>PKCS7_PARTIAL</strong> set or in the case or re-signing a valid PKCS#7 signed data structure.</p> <p>If the <em>md</em> parameter is NULL then the default digest for the public key algorithm will be used.</p> <p>Unless the <strong>PKCS7_REUSE_DIGEST</strong> flag is set the returned <strong>PKCS7</strong> structure is not complete and must be finalized either by streaming (if applicable) or a call to PKCS7_final().</p> <p> </p> <hr /> <h1><a name="notes">NOTES</a></h1> <p>The main purpose of this function is to provide finer control over a PKCS#7 signed data structure where the simpler PKCS7_sign() function defaults are not appropriate. For example if multiple signers or non default digest algorithms are needed.</p> <p>Any of the following flags (ored together) can be passed in the <em>flags</em> parameter.</p> <p>If <strong>PKCS7_REUSE_DIGEST</strong> is set then an attempt is made to copy the content digest value from the <strong>PKCS7</strong> structure: to add a signer to an existing structure. An error occurs if a matching digest value cannot be found to copy. The returned <strong>PKCS7</strong> structure will be valid and finalized when this flag is set.</p> <p>If <strong>PKCS7_PARTIAL</strong> is set in addition to <strong>PKCS7_REUSE_DIGEST</strong> then the <strong>PKCS7_SIGNER_INO</strong> structure will not be finalized so additional attributes can be added. In this case an explicit call to PKCS7_SIGNER_INFO_sign() is needed to finalize it.</p> <p>If <strong>PKCS7_NOCERTS</strong> is set the signer's certificate will not be included in the <strong>PKCS7</strong> structure, the signer's certificate must still be supplied in the <em>signcert</em> parameter though. This can reduce the size of the signature if the signers certificate can be obtained by other means: for example a previously signed message.</p> <p>The signedData structure includes several PKCS#7 authenticatedAttributes including the signing time, the PKCS#7 content type and the supported list of ciphers in an SMIMECapabilities attribute. If <strong>PKCS7_NOATTR</strong> is set then no authenticatedAttributes will be used. If <strong>PKCS7_NOSMIMECAP</strong> is set then just the SMIMECapabilities are omitted.</p> <p>If present the SMIMECapabilities attribute indicates support for the following algorithms: triple DES, 128 bit RC2, 64 bit RC2, DES and 40 bit RC2. If any of these algorithms is disabled then it will not be included.</p> <p>PKCS7_sign_add_signers() returns an internal pointer to the <strong>PKCS7_SIGNER_INFO</strong> structure just added, which can be used to set additional attributes before it is finalized.</p> <p>PKCS7_add_certificate() adds to the <strong>PKCS7</strong> structure <em>p7</em> the certificate <em>cert</em>, which may be an end-entity (signer) certificate or a CA certificate useful for chain building. This is done internally by <em>PKCS7_sign_ex(3)</em> and similar signing functions. It may have to be used before calling <em>PKCS7_verify(3)</em> in order to provide any missing certificate(s) needed for verification.</p> <p>PKCS7_add_crl() adds the CRL <em>crl</em> to the <strong>PKCS7</strong> structure <em>p7</em>. This may be called to provide certificate status information to be included when signing or to use when verifying the <strong>PKCS7</strong> structure.</p> <p> </p> <hr /> <h1><a name="return_values">RETURN VALUES</a></h1> <p>PKCS7_sign_add_signers() returns an internal pointer to the <strong>PKCS7_SIGNER_INFO</strong> structure just added or NULL if an error occurs.</p> <p>PKCS7_add_certificate() and PKCS7_add_crl() return 1 on success, 0 on error.</p> <p> </p> <hr /> <h1><a name="see_also">SEE ALSO</a></h1> <p><em>ERR_get_error(3)</em>, <em>PKCS7_sign_ex(3)</em>, <em>PKCS7_final(3)</em>, <em>PKCS7_verify(3)</em></p> <p> </p> <hr /> <h1><a name="history">HISTORY</a></h1> <p>The PPKCS7_sign_add_signer() function was added in OpenSSL 1.0.0.</p> <p> </p> <hr /> <h1><a name="copyright">COPYRIGHT</a></h1> <p>Copyright 2007-2022 The OpenSSL Project Authors. All Rights Reserved.</p> <p>Licensed under the OpenSSL license (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>