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/EVP_OpenInit.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>EVP_OpenInit</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="#copyright">COPYRIGHT</a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <hr /> <h1><a name="name">NAME</a></h1> <p>EVP_OpenInit, EVP_OpenUpdate, EVP_OpenFinal - EVP envelope decryption</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> #include <openssl/evp.h></pre> <pre> int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek, int ekl, unsigned char *iv, EVP_PKEY *priv); int EVP_OpenUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, unsigned char *in, int inl); int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);</pre> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>The EVP envelope routines are a high-level interface to envelope decryption. They decrypt a public key encrypted symmetric key and then decrypt data using it.</p> <p><code>EVP_OpenInit()</code> initializes a cipher context <strong>ctx</strong> for decryption with cipher <strong>type</strong>. It decrypts the encrypted symmetric key of length <strong>ekl</strong> bytes passed in the <strong>ek</strong> parameter using the private key <strong>priv</strong>. The IV is supplied in the <strong>iv</strong> parameter.</p> <p><code>EVP_OpenUpdate()</code> and <code>EVP_OpenFinal()</code> have exactly the same properties as the <code>EVP_DecryptUpdate()</code> and <code>EVP_DecryptFinal()</code> routines, as documented on the <em>EVP_EncryptInit(3)</em> manual page.</p> <p> </p> <hr /> <h1><a name="notes">NOTES</a></h1> <p>It is possible to call <code>EVP_OpenInit()</code> twice in the same way as <code>EVP_DecryptInit()</code>. The first call should have <strong>priv</strong> set to NULL and (after setting any cipher parameters) it should be called again with <strong>type</strong> set to NULL.</p> <p>If the cipher passed in the <strong>type</strong> parameter is a variable length cipher then the key length will be set to the value of the recovered key length. If the cipher is a fixed length cipher then the recovered key length must match the fixed cipher length.</p> <p> </p> <hr /> <h1><a name="return_values">RETURN VALUES</a></h1> <p><code>EVP_OpenInit()</code> returns 0 on error or a non zero integer (actually the recovered secret key size) if successful.</p> <p><code>EVP_OpenUpdate()</code> returns 1 for success or 0 for failure.</p> <p><code>EVP_OpenFinal()</code> returns 0 if the decrypt failed or 1 for success.</p> <p> </p> <hr /> <h1><a name="see_also">SEE ALSO</a></h1> <p><em>evp(7)</em>, <em>RAND_bytes(3)</em>, <em>EVP_EncryptInit(3)</em>, <em>EVP_SealInit(3)</em></p> <p> </p> <hr /> <h1><a name="copyright">COPYRIGHT</a></h1> <p>Copyright 2000-2020 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>