1RSA_SIGN(3)                         OpenSSL                        RSA_SIGN(3)
2
3
4

NAME

6       RSA_sign, RSA_verify - RSA signatures
7

SYNOPSIS

9        #include <openssl/rsa.h>
10
11        int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
12                     unsigned char *sigret, unsigned int *siglen, RSA *rsa);
13
14        int RSA_verify(int type, const unsigned char *m, unsigned int m_len,
15                       unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
16

DESCRIPTION

18       RSA_sign() signs the message digest m of size m_len using the private
19       key rsa using RSASSA-PKCS1-v1_5 as specified in RFC 3447. It stores the
20       signature in sigret and the signature size in siglen.  sigret must
21       point to RSA_size(rsa) bytes of memory.  Note that PKCS #1 adds meta-
22       data, placing limits on the size of the key that can be used.  See
23       RSA_private_encrypt(3) for lower-level operations.
24
25       type denotes the message digest algorithm that was used to generate m.
26       If type is NID_md5_sha1, an SSL signature (MD5 and SHA1 message digests
27       with PKCS #1 padding and no algorithm identifier) is created.
28
29       RSA_verify() verifies that the signature sigbuf of size siglen matches
30       a given message digest m of size m_len. type denotes the message digest
31       algorithm that was used to generate the signature.  rsa is the signer's
32       public key.
33

RETURN VALUES

35       RSA_sign() returns 1 on success.  RSA_verify() returns 1 on successful
36       verification.
37
38       The error codes can be obtained by ERR_get_error(3).
39

CONFORMING TO

41       SSL, PKCS #1 v2.0
42

SEE ALSO

44       ERR_get_error(3), RSA_private_encrypt(3), RSA_public_decrypt(3)
45
47       Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
48
49       Licensed under the OpenSSL license (the "License").  You may not use
50       this file except in compliance with the License.  You can obtain a copy
51       in the file LICENSE in the source distribution or at
52       <https://www.openssl.org/source/license.html>.
53
54
55
561.1.1d                            2019-10-03                       RSA_SIGN(3)
Impressum