New docs.
[openssl.git] / doc / crypto / EVP_PKEY_sign.pod
1 =pod
2
3 =head1 NAME
4
5 EVP_PKEY_sign_init, EVP_PKEY_sign - sign using a public key algorithm
6
7 =head1 SYNOPSIS
8
9  #include <openssl/evp.h>
10
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);
15
16 =head1 DESCRIPTION
17
18 The EVP_PKEY_sign_init() function initializes a public key algorithm
19 context using key B<pkey> for a signing operation.
20
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>.
28
29 =head1 NOTES
30
31 After the call to EVP_PKEY_sign_init() algorithm specific control
32 operations can be performed to set any appropriate parameters for the
33 operation.
34
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.
37
38 =head1 RETURN VALUES
39
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.
43
44 =head1 EXAMPLE
45
46 Sign data using PKCS#1 and SHA256 digest:
47
48 [to be added]
49
50 =head1 SEE ALSO
51
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)> 
58
59 =head1 HISTORY
60
61 These functions were first added to OpenSSL 0.9.9.
62
63 =cut