1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos RSA_sign, RSA_verify - RSA signatures 6 1.1 christos 7 1.1 christos =head1 SYNOPSIS 8 1.1 christos 9 1.1 christos #include <openssl/rsa.h> 10 1.1 christos 11 1.1.1.2 christos The following functions have been deprecated since OpenSSL 3.0, and can be 12 1.1.1.2 christos hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value, 13 1.1.1.2 christos see L<openssl_user_macros(7)>: 14 1.1.1.2 christos 15 1.1 christos int RSA_sign(int type, const unsigned char *m, unsigned int m_len, 16 1.1 christos unsigned char *sigret, unsigned int *siglen, RSA *rsa); 17 1.1 christos 18 1.1 christos int RSA_verify(int type, const unsigned char *m, unsigned int m_len, 19 1.1 christos unsigned char *sigbuf, unsigned int siglen, RSA *rsa); 20 1.1 christos 21 1.1 christos =head1 DESCRIPTION 22 1.1 christos 23 1.1.1.2 christos All of the functions described on this page are deprecated. 24 1.1.1.2 christos Applications should instead use L<EVP_PKEY_sign_init(3)>, L<EVP_PKEY_sign(3)>, 25 1.1.1.2 christos L<EVP_PKEY_verify_init(3)> and L<EVP_PKEY_verify(3)>. 26 1.1.1.2 christos 27 1.1 christos RSA_sign() signs the message digest B<m> of size B<m_len> using the 28 1.1 christos private key B<rsa> using RSASSA-PKCS1-v1_5 as specified in RFC 3447. It 29 1.1 christos stores the signature in B<sigret> and the signature size in B<siglen>. 30 1.1 christos B<sigret> must point to RSA_size(B<rsa>) bytes of memory. 31 1.1 christos Note that PKCS #1 adds meta-data, placing limits on the size of the 32 1.1 christos key that can be used. 33 1.1 christos See L<RSA_private_encrypt(3)> for lower-level 34 1.1 christos operations. 35 1.1 christos 36 1.1 christos B<type> denotes the message digest algorithm that was used to generate 37 1.1 christos B<m>. 38 1.1 christos If B<type> is B<NID_md5_sha1>, 39 1.1 christos an SSL signature (MD5 and SHA1 message digests with PKCS #1 padding 40 1.1 christos and no algorithm identifier) is created. 41 1.1 christos 42 1.1 christos RSA_verify() verifies that the signature B<sigbuf> of size B<siglen> 43 1.1 christos matches a given message digest B<m> of size B<m_len>. B<type> denotes 44 1.1 christos the message digest algorithm that was used to generate the signature. 45 1.1 christos B<rsa> is the signer's public key. 46 1.1 christos 47 1.1 christos =head1 RETURN VALUES 48 1.1 christos 49 1.1.1.2 christos RSA_sign() returns 1 on success and 0 for failure. 50 1.1.1.2 christos RSA_verify() returns 1 on successful verification and 0 for failure. 51 1.1 christos 52 1.1 christos The error codes can be obtained by L<ERR_get_error(3)>. 53 1.1 christos 54 1.1 christos =head1 CONFORMING TO 55 1.1 christos 56 1.1 christos SSL, PKCS #1 v2.0 57 1.1 christos 58 1.1 christos =head1 SEE ALSO 59 1.1 christos 60 1.1 christos L<ERR_get_error(3)>, 61 1.1 christos L<RSA_private_encrypt(3)>, 62 1.1 christos L<RSA_public_decrypt(3)> 63 1.1 christos 64 1.1.1.2 christos =head1 HISTORY 65 1.1.1.2 christos 66 1.1.1.2 christos All of these functions were deprecated in OpenSSL 3.0. 67 1.1.1.2 christos 68 1.1 christos =head1 COPYRIGHT 69 1.1 christos 70 1.1.1.2 christos Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved. 71 1.1 christos 72 1.1.1.2 christos Licensed under the Apache License 2.0 (the "License"). You may not use 73 1.1 christos this file except in compliance with the License. You can obtain a copy 74 1.1 christos in the file LICENSE in the source distribution or at 75 1.1 christos L<https://www.openssl.org/source/license.html>. 76 1.1 christos 77 1.1 christos =cut 78