5 EVP_PKEY_encrypt_init, EVP_PKEY_encrypt - encrypt using a public key algorithm
9 #include <openssl/evp.h>
11 int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx);
12 int EVP_PKEY_sign(EVP_PKEY_CTX *ctx,
13 unsigned char *sig, size_t *siglen,
14 const unsigned char *tbs, size_t tbslen);
18 The EVP_PKEY_sign_init() function initializes a public key algorithm
19 context using key B<pkey> for a signing operation.
21 The EVP_PKEY_sign() function performs a public key signing operation
22 using B<ctx>. The data to be signed is specified using the B<tbs> and
23 B<tbslen> parameters. If B<sig> is B<NULL> then the maximum size of the output
24 buffer is written to the B<siglen> parameter. If B<sig> is not B<NULL> then
25 before the call the B<siglen> parameter should contain the length of the
26 B<sig> buffer, if the call is successful the signature is written to
27 B<sig> and the amount of data written to B<siglen>.
31 After the call to EVP_PKEY_sign_init() algorithm specific control
32 operations can be performed to set any appropriate parameters for the
35 The function EVP_PKEY_sign() can be called more than once on the same
36 context if several operations are performed using the same parameters.
40 EVP_PKEY_sign_init() and EVP_PKEY_sign() return 1 for success and 0
41 or a negative value for failure. In particular a return value of -2
42 indicates the operation is not supported by the public key algorithm.
46 Sign data using PKCS#1 and SHA256 digest:
52 L<EVP_PKEY_CTX_new(3)|EVP_PKEY_CTX_new(3)>,
53 L<EVP_PKEY_encrypt(3)|EVP_PKEY_encrypt(3)>,
54 L<EVP_PKEY_decrypt(3)|EVP_PKEY_decrypt(3)>,
55 L<EVP_PKEY_verify(3)|EVP_PKEY_verify(3)>,
56 L<EVP_PKEY_verifyrecover(3)|EVP_PKEY_verifyrecover(3)>,
57 L<EVP_PKEY_derive(3)|EVP_PKEY_derive(3)>
61 These functions were first added to OpenSSL 0.9.9.