xref: /freebsd/crypto/openssl/doc/man3/RSA_sign_ASN1_OCTET_STRING.pod (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1=pod
2
3=head1 NAME
4
5RSA_sign_ASN1_OCTET_STRING, RSA_verify_ASN1_OCTET_STRING - RSA signatures
6
7=head1 SYNOPSIS
8
9 #include <openssl/rsa.h>
10
11 int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m,
12                                unsigned int m_len, unsigned char *sigret,
13                                unsigned int *siglen, RSA *rsa);
14
15 int RSA_verify_ASN1_OCTET_STRING(int dummy, unsigned char *m,
16                                  unsigned int m_len, unsigned char *sigbuf,
17                                  unsigned int siglen, RSA *rsa);
18
19=head1 DESCRIPTION
20
21RSA_sign_ASN1_OCTET_STRING() signs the octet string B<m> of size
22B<m_len> using the private key B<rsa> represented in DER using PKCS #1
23padding. It stores the signature in B<sigret> and the signature size
24in B<siglen>. B<sigret> must point to B<RSA_size(rsa)> bytes of
25memory.
26
27B<dummy> is ignored.
28
29The random number generator must be seeded when calling
30RSA_sign_ASN1_OCTET_STRING().
31If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
32external circumstances (see L<RAND(7)>), the operation will fail.
33
34RSA_verify_ASN1_OCTET_STRING() verifies that the signature B<sigbuf>
35of size B<siglen> is the DER representation of a given octet string
36B<m> of size B<m_len>. B<dummy> is ignored. B<rsa> is the signer's
37public key.
38
39=head1 RETURN VALUES
40
41RSA_sign_ASN1_OCTET_STRING() returns 1 on success, 0 otherwise.
42RSA_verify_ASN1_OCTET_STRING() returns 1 on successful verification, 0
43otherwise.
44
45The error codes can be obtained by L<ERR_get_error(3)>.
46
47=head1 BUGS
48
49These functions serve no recognizable purpose.
50
51=head1 SEE ALSO
52
53L<ERR_get_error(3)>,
54L<RAND_bytes(3)>, L<RSA_sign(3)>,
55L<RSA_verify(3)>,
56L<RAND(7)>
57
58=head1 COPYRIGHT
59
60Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
61
62Licensed under the OpenSSL license (the "License").  You may not use
63this file except in compliance with the License.  You can obtain a copy
64in the file LICENSE in the source distribution or at
65L<https://www.openssl.org/source/license.html>.
66
67=cut
68