5 EVP_PKEY_verifyrecover_init, EVP_PKEY_verifyrecover - recover signature using a public key algorithm
9 #include <openssl/evp.h>
11 int EVP_PKEY_verifyrecover_init(EVP_PKEY_CTX *ctx);
12 int EVP_PKEY_verifyrecover(EVP_PKEY_CTX *ctx,
13 unsigned char *rout, size_t *routlen,
14 const unsigned char *sig, size_t siglen);
18 The EVP_PKEY_verifyrecover_init() function initializes a public key algorithm
19 context using key B<pkey> for a verify recover operation.
21 The EVP_PKEY_verifyrecover() function recovers signed data
22 using B<ctx>. The signature is specified using the B<sig> and
23 B<siglen> parameters. If B<rout> is B<NULL> then the maximum size of the output
24 buffer is written to the B<routlen> parameter. If B<rout> is not B<NULL> then
25 before the call the B<routlen> parameter should contain the length of the
26 B<rout> buffer, if the call is successful recovered data is written to
27 B<rout> and the amount of data written to B<routlen>.
31 Normally an application is only interested in whether a signature verification
32 operation is successful in those cases the EVP_verify() function should be
35 Sometimes however it is useful to obtain the data originally signed using a
36 signing operation. Only certain public key algorithms can recover a signature
37 in this way (for example RSA in PKCS padding mode).
39 After the call to EVP_PKEY_verifyrecover_init() algorithm specific control
40 operations can be performed to set any appropriate parameters for the
43 The function EVP_PKEY_verifyrecover() can be called more than once on the same
44 context if several operations are performed using the same parameters.
48 EVP_PKEY_verifyrecover_init() and EVP_PKEY_verifyrecover() return 1 for success
49 and 0 or a negative value for failure. In particular a return value of -2
50 indicates the operation is not supported by the public key algorithm.
54 Recover digest originally signed using PKCS#1 and SHA256 digest:
60 L<EVP_PKEY_CTX_new(3)|EVP_PKEY_CTX_new(3)>,
61 L<EVP_PKEY_encrypt(3)|EVP_PKEY_encrypt(3)>,
62 L<EVP_PKEY_decrypt(3)|EVP_PKEY_decrypt(3)>,
63 L<EVP_PKEY_sign(3)|EVP_PKEY_sign(3)>,
64 L<EVP_PKEY_verify(3)|EVP_PKEY_verify(3)>,
65 L<EVP_PKEY_derive(3)|EVP_PKEY_derive(3)>
69 These functions were first added to OpenSSL 0.9.9.