summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/EVP_SignInit.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/EVP_SignInit.3')
-rw-r--r--src/lib/libcrypto/man/EVP_SignInit.3229
1 files changed, 0 insertions, 229 deletions
diff --git a/src/lib/libcrypto/man/EVP_SignInit.3 b/src/lib/libcrypto/man/EVP_SignInit.3
deleted file mode 100644
index a53d059b46..0000000000
--- a/src/lib/libcrypto/man/EVP_SignInit.3
+++ /dev/null
@@ -1,229 +0,0 @@
1.\" $OpenBSD: EVP_SignInit.3,v 1.14 2019/06/10 14:58:48 schwarze Exp $
2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\" selective merge up to: OpenSSL 79b49fb0 Mar 20 10:03:10 2018 +1000
4.\"
5.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
6.\" Copyright (c) 2000-2002, 2005, 2006, 2014-2016 The OpenSSL Project.
7.\" All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\" notice, this list of conditions and the following disclaimer in
18.\" the documentation and/or other materials provided with the
19.\" distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\" software must display the following acknowledgment:
23.\" "This product includes software developed by the OpenSSL Project
24.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\" endorse or promote products derived from this software without
28.\" prior written permission. For written permission, please contact
29.\" openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\" nor may "OpenSSL" appear in their names without prior written
33.\" permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\" acknowledgment:
37.\" "This product includes software developed by the OpenSSL Project
38.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: June 10 2019 $
54.Dt EVP_SIGNINIT 3
55.Os
56.Sh NAME
57.Nm EVP_SignInit_ex ,
58.Nm EVP_SignUpdate ,
59.Nm EVP_SignFinal ,
60.Nm EVP_SignInit ,
61.Nm EVP_PKEY_size ,
62.Nm EVP_PKEY_bits
63.Nd EVP signing functions
64.Sh SYNOPSIS
65.In openssl/evp.h
66.Ft int
67.Fo EVP_SignInit_ex
68.Fa "EVP_MD_CTX *ctx"
69.Fa "const EVP_MD *type"
70.Fa "ENGINE *impl"
71.Fc
72.Ft int
73.Fo EVP_SignUpdate
74.Fa "EVP_MD_CTX *ctx"
75.Fa "const void *d"
76.Fa "unsigned int cnt"
77.Fc
78.Ft int
79.Fo EVP_SignFinal
80.Fa "EVP_MD_CTX *ctx"
81.Fa "unsigned char *sig"
82.Fa "unsigned int *s"
83.Fa "EVP_PKEY *pkey"
84.Fc
85.Ft void
86.Fo EVP_SignInit
87.Fa "EVP_MD_CTX *ctx"
88.Fa "const EVP_MD *type"
89.Fc
90.Ft int
91.Fo EVP_PKEY_size
92.Fa "const EVP_PKEY *pkey"
93.Fc
94.Ft int
95.Fo EVP_PKEY_bits
96.Fa "const EVP_PKEY *pkey"
97.Fc
98.Sh DESCRIPTION
99The EVP signature routines are a high level interface to digital
100signatures.
101.Pp
102.Fn EVP_SignInit_ex
103sets up a signing context
104.Fa ctx
105to use the digest
106.Fa type
107from
108.Vt ENGINE
109.Fa impl .
110.Fa ctx
111must be initialized with
112.Xr EVP_MD_CTX_init 3
113before calling this function.
114.Pp
115.Fn EVP_SignUpdate
116hashes
117.Fa cnt
118bytes of data at
119.Fa d
120into the signature context
121.Fa ctx .
122This function can be called several times on the same
123.Fa ctx
124to include additional data.
125.Pp
126.Fn EVP_SignFinal
127signs the data in
128.Fa ctx
129using the private key
130.Fa pkey
131and places the signature in
132.Fa sig .
133.Fa sig
134must be at least
135.Fn EVP_PKEY_size pkey
136bytes in size.
137.Fa s
138is an OUT parameter, and not used as an IN parameter.
139The number of bytes of data written (i.e.\&
140the length of the signature) will be written to the integer at
141.Fa s .
142At most
143.Fn EVP_PKEY_size pkey
144bytes will be written.
145.Pp
146.Fn EVP_SignInit
147initializes a signing context
148.Fa ctx
149to use the default implementation of digest
150.Fa type .
151.Pp
152.Fn EVP_PKEY_size
153returns the maximum size of a signature in bytes.
154The actual signature returned by
155.Fn EVP_SignFinal
156may be smaller.
157.Pp
158The EVP interface to digital signatures should almost always be
159used in preference to the low level interfaces.
160This is because the code then becomes transparent to the algorithm used
161and much more flexible.
162.Pp
163The call to
164.Fn EVP_SignFinal
165internally finalizes a copy of the digest context.
166This means that calls to
167.Fn EVP_SignUpdate
168and
169.Fn EVP_SignFinal
170can be called later to digest and sign additional data.
171.Pp
172Since only a copy of the digest context is ever finalized, the context
173must be cleaned up after use by calling
174.Xr EVP_MD_CTX_free 3
175or a memory leak will occur.
176.Sh RETURN VALUES
177.Fn EVP_SignInit_ex ,
178.Fn EVP_SignUpdate ,
179and
180.Fn EVP_SignFinal
181return 1 for success and 0 for failure.
182.Pp
183.Fn EVP_PKEY_size
184returns the maximum size of a signature in bytes.
185.Pp
186.Fn EVP_PKEY_bits
187returns the number of significant bits in the key
188or 0 if an error occurs.
189.Pp
190The error codes can be obtained by
191.Xr ERR_get_error 3 .
192.Sh SEE ALSO
193.Xr evp 3 ,
194.Xr EVP_DigestInit 3 ,
195.Xr EVP_PKEY_asn1_set_public 3 ,
196.Xr EVP_VerifyInit 3
197.Sh HISTORY
198.Fn EVP_SignInit ,
199.Fn EVP_SignUpdate ,
200and
201.Fn EVP_SignFinal
202first appeared in SSLeay 0.5.1.
203.Fn EVP_PKEY_size
204first appeared in SSLeay 0.6.0.
205.Fn EVP_PKEY_bits
206first appeared in SSLeay 0.9.0.
207These functions have been available since
208.Ox 2.4 .
209.Pp
210.Fn EVP_SignInit_ex
211first appeared in OpenSSL 0.9.7 and has been available since
212.Ox 3.2 .
213.Sh BUGS
214Older versions of this documentation wrongly stated that calls to
215.Fn EVP_SignUpdate
216could not be made after calling
217.Fn EVP_SignFinal .
218.Pp
219Since the private key is passed in the call to
220.Fn EVP_SignFinal
221any error relating to the private key (for example an unsuitable key and
222digest combination) will not be indicated until after potentially large
223amounts of data have been passed through
224.Fn EVP_SignUpdate .
225.Pp
226It is not possible to change the signing parameters using these
227function.
228.Pp
229The previous two bugs are fixed in the newer EVP_DigestSign* function.