xref: /freebsd/crypto/openssl/doc/man3/RSA_sign_ASN1_OCTET_STRING.pod (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1e71b7053SJung-uk Kim=pod
2e71b7053SJung-uk Kim
3e71b7053SJung-uk Kim=head1 NAME
4e71b7053SJung-uk Kim
5e71b7053SJung-uk KimRSA_sign_ASN1_OCTET_STRING, RSA_verify_ASN1_OCTET_STRING - RSA signatures
6e71b7053SJung-uk Kim
7e71b7053SJung-uk Kim=head1 SYNOPSIS
8e71b7053SJung-uk Kim
9e71b7053SJung-uk Kim #include <openssl/rsa.h>
10e71b7053SJung-uk Kim
11*b077aed3SPierre ProncheryThe following functions have been deprecated since OpenSSL 3.0, and can be
12*b077aed3SPierre Proncheryhidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
13*b077aed3SPierre Proncherysee L<openssl_user_macros(7)>:
14*b077aed3SPierre Pronchery
15e71b7053SJung-uk Kim int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m,
16e71b7053SJung-uk Kim                                unsigned int m_len, unsigned char *sigret,
17e71b7053SJung-uk Kim                                unsigned int *siglen, RSA *rsa);
18e71b7053SJung-uk Kim
19e71b7053SJung-uk Kim int RSA_verify_ASN1_OCTET_STRING(int dummy, unsigned char *m,
20e71b7053SJung-uk Kim                                  unsigned int m_len, unsigned char *sigbuf,
21e71b7053SJung-uk Kim                                  unsigned int siglen, RSA *rsa);
22e71b7053SJung-uk Kim
23e71b7053SJung-uk Kim=head1 DESCRIPTION
24e71b7053SJung-uk Kim
25*b077aed3SPierre ProncheryAll of the functions described on this page are deprecated.
26*b077aed3SPierre ProncheryApplications should instead use EVP PKEY APIs.
27*b077aed3SPierre Pronchery
28e71b7053SJung-uk KimRSA_sign_ASN1_OCTET_STRING() signs the octet string B<m> of size
29e71b7053SJung-uk KimB<m_len> using the private key B<rsa> represented in DER using PKCS #1
30e71b7053SJung-uk Kimpadding. It stores the signature in B<sigret> and the signature size
31e71b7053SJung-uk Kimin B<siglen>. B<sigret> must point to B<RSA_size(rsa)> bytes of
32e71b7053SJung-uk Kimmemory.
33e71b7053SJung-uk Kim
34e71b7053SJung-uk KimB<dummy> is ignored.
35e71b7053SJung-uk Kim
36da327cd2SJung-uk KimThe random number generator must be seeded when calling
37da327cd2SJung-uk KimRSA_sign_ASN1_OCTET_STRING().
38da327cd2SJung-uk KimIf the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
39da327cd2SJung-uk Kimexternal circumstances (see L<RAND(7)>), the operation will fail.
40e71b7053SJung-uk Kim
41e71b7053SJung-uk KimRSA_verify_ASN1_OCTET_STRING() verifies that the signature B<sigbuf>
42e71b7053SJung-uk Kimof size B<siglen> is the DER representation of a given octet string
43e71b7053SJung-uk KimB<m> of size B<m_len>. B<dummy> is ignored. B<rsa> is the signer's
44e71b7053SJung-uk Kimpublic key.
45e71b7053SJung-uk Kim
46e71b7053SJung-uk Kim=head1 RETURN VALUES
47e71b7053SJung-uk Kim
48e71b7053SJung-uk KimRSA_sign_ASN1_OCTET_STRING() returns 1 on success, 0 otherwise.
49e71b7053SJung-uk KimRSA_verify_ASN1_OCTET_STRING() returns 1 on successful verification, 0
50e71b7053SJung-uk Kimotherwise.
51e71b7053SJung-uk Kim
52e71b7053SJung-uk KimThe error codes can be obtained by L<ERR_get_error(3)>.
53e71b7053SJung-uk Kim
54e71b7053SJung-uk Kim=head1 BUGS
55e71b7053SJung-uk Kim
56e71b7053SJung-uk KimThese functions serve no recognizable purpose.
57e71b7053SJung-uk Kim
58e71b7053SJung-uk Kim=head1 SEE ALSO
59e71b7053SJung-uk Kim
60e71b7053SJung-uk KimL<ERR_get_error(3)>,
61e71b7053SJung-uk KimL<RAND_bytes(3)>, L<RSA_sign(3)>,
62da327cd2SJung-uk KimL<RSA_verify(3)>,
63da327cd2SJung-uk KimL<RAND(7)>
64e71b7053SJung-uk Kim
65*b077aed3SPierre Pronchery=head1 HISTORY
66*b077aed3SPierre Pronchery
67*b077aed3SPierre ProncheryAll of these functions were deprecated in OpenSSL 3.0.
68*b077aed3SPierre Pronchery
69e71b7053SJung-uk Kim=head1 COPYRIGHT
70e71b7053SJung-uk Kim
71*b077aed3SPierre ProncheryCopyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
72e71b7053SJung-uk Kim
73*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
74e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
75e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
76e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
77e71b7053SJung-uk Kim
78e71b7053SJung-uk Kim=cut
79