RSA_sign.pod 2.3 KB

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