openssl-prebuild/linux_amd64/ssl/share/doc/openssl/html/man3/RSA_sign.html

114 lines
4.1 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>RSA_sign</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="#return_values">RETURN VALUES</a></li>
<li><a href="#conforming_to">CONFORMING TO</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>RSA_sign, RSA_verify - RSA signatures</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
#include &lt;openssl/rsa.h&gt;</pre>
<p>Deprecated since OpenSSL 3.0, can be hidden entirely by defining
<strong>OPENSSL_API_COMPAT</strong> with a suitable version value, see
<em>openssl_user_macros(7)</em>:</p>
<pre>
int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
unsigned char *sigret, unsigned int *siglen, RSA *rsa);</pre>
<pre>
int RSA_verify(int type, const unsigned char *m, unsigned int m_len,
unsigned char *sigbuf, unsigned int siglen, RSA *rsa);</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>All of the functions described on this page are deprecated.
Applications should instead use <em>EVP_PKEY_sign_init(3)</em>, <em>EVP_PKEY_sign(3)</em>,
<em>EVP_PKEY_verify_init(3)</em> and <em>EVP_PKEY_verify(3)</em>.</p>
<p><code>RSA_sign()</code> signs the message digest <strong>m</strong> of size <strong>m_len</strong> using the
private key <strong>rsa</strong> using RSASSA-PKCS1-v1_5 as specified in <a href="http://www.ietf.org/rfc/rfc3447.txt" class="rfc">RFC 3447</a>. It
stores the signature in <strong>sigret</strong> and the signature size in <strong>siglen</strong>.
<strong>sigret</strong> must point to RSA_size(<strong>rsa</strong>) bytes of memory.
Note that PKCS #1 adds meta-data, placing limits on the size of the
key that can be used.
See <em>RSA_private_encrypt(3)</em> for lower-level
operations.</p>
<p><strong>type</strong> denotes the message digest algorithm that was used to generate
<strong>m</strong>.
If <strong>type</strong> is <strong>NID_md5_sha1</strong>,
an SSL signature (MD5 and SHA1 message digests with PKCS #1 padding
and no algorithm identifier) is created.</p>
<p><code>RSA_verify()</code> verifies that the signature <strong>sigbuf</strong> of size <strong>siglen</strong>
matches a given message digest <strong>m</strong> of size <strong>m_len</strong>. <strong>type</strong> denotes
the message digest algorithm that was used to generate the signature.
<strong>rsa</strong> is the signer's public key.</p>
<p>
</p>
<hr />
<h1><a name="return_values">RETURN VALUES</a></h1>
<p><code>RSA_sign()</code> returns 1 on success.
<code>RSA_verify()</code> returns 1 on successful verification.</p>
<p>The error codes can be obtained by <em>ERR_get_error(3)</em>.</p>
<p>
</p>
<hr />
<h1><a name="conforming_to">CONFORMING TO</a></h1>
<p>SSL, PKCS #1 v2.0</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><em>ERR_get_error(3)</em>,
<em>RSA_private_encrypt(3)</em>,
<em>RSA_public_decrypt(3)</em></p>
<p>
</p>
<hr />
<h1><a name="history">HISTORY</a></h1>
<p>All of these functions were deprecated in OpenSSL 3.0.</p>
<p>
</p>
<hr />
<h1><a name="copyright">COPYRIGHT</a></h1>
<p>Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.</p>
<p>Licensed under the Apache License 2.0 (the &quot;License&quot;). 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>