summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/RSA_meth_new.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/RSA_meth_new.3')
-rw-r--r--src/lib/libcrypto/man/RSA_meth_new.3193
1 files changed, 193 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/RSA_meth_new.3 b/src/lib/libcrypto/man/RSA_meth_new.3
new file mode 100644
index 0000000000..ae3ca88adb
--- /dev/null
+++ b/src/lib/libcrypto/man/RSA_meth_new.3
@@ -0,0 +1,193 @@
1.\" $OpenBSD: RSA_meth_new.3,v 1.1 2018/03/18 13:06:36 schwarze Exp $
2.\" selective merge up to: OpenSSL a970b14f Jul 31 18:58:40 2017 -0400
3.\"
4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Richard Levitte <levitte@openssl.org>.
22.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved.
23.\"
24.\" Redistribution and use in source and binary forms, with or without
25.\" modification, are permitted provided that the following conditions
26.\" are met:
27.\"
28.\" 1. Redistributions of source code must retain the above copyright
29.\" notice, this list of conditions and the following disclaimer.
30.\"
31.\" 2. Redistributions in binary form must reproduce the above copyright
32.\" notice, this list of conditions and the following disclaimer in
33.\" the documentation and/or other materials provided with the
34.\" distribution.
35.\"
36.\" 3. All advertising materials mentioning features or use of this
37.\" software must display the following acknowledgment:
38.\" "This product includes software developed by the OpenSSL Project
39.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
40.\"
41.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
42.\" endorse or promote products derived from this software without
43.\" prior written permission. For written permission, please contact
44.\" openssl-core@openssl.org.
45.\"
46.\" 5. Products derived from this software may not be called "OpenSSL"
47.\" nor may "OpenSSL" appear in their names without prior written
48.\" permission of the OpenSSL Project.
49.\"
50.\" 6. Redistributions of any form whatsoever must retain the following
51.\" acknowledgment:
52.\" "This product includes software developed by the OpenSSL Project
53.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
54.\"
55.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
56.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
58.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
59.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
60.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
61.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
62.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
63.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
64.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
67.\"
68.Dd $Mdocdate: March 18 2018 $
69.Dt RSA_METH_NEW 3
70.Os
71.Sh NAME
72.Nm RSA_meth_new ,
73.Nm RSA_meth_free ,
74.Nm RSA_meth_dup ,
75.Nm RSA_meth_set_finish ,
76.Nm RSA_meth_set_priv_enc ,
77.Nm RSA_meth_set_priv_dec
78.Nd build up RSA methods
79.Sh SYNOPSIS
80.In openssl/rsa.h
81.Ft RSA_METHOD *
82.Fo RSA_meth_new
83.Fa "const char *name"
84.Fa "int flags"
85.Fc
86.Ft void
87.Fo RSA_meth_free
88.Fa "RSA_METHOD *meth"
89.Fc
90.Ft RSA_METHOD *
91.Fo RSA_meth_dup
92.Fa "const RSA_METHOD *meth"
93.Fc
94.Ft int
95.Fo RSA_meth_set_finish
96.Fa "RSA_METHOD *meth"
97.Fa "int (*finish)(RSA *rsa)"
98.Fc
99.Ft int
100.Fo RSA_meth_set_priv_enc
101.Fa "RSA_METHOD *meth"
102.Fa "int (*priv_enc)(int flen, const unsigned char *from,\
103 unsigned char *to, RSA *rsa, int padding)"
104.Fc
105.Ft int
106.Fo RSA_meth_set_priv_dec
107.Fa "RSA_METHOD *meth"
108.Fa "int (*priv_dec)(int flen, const unsigned char *from,\
109 unsigned char *to, RSA *rsa, int padding)"
110.Fc
111.Sh DESCRIPTION
112The
113.Vt RSA_METHOD
114structure holds function pointers for custom RSA implementations.
115.Pp
116.Fn RSA_meth_new
117creates a new
118.Vt RSA_METHOD
119structure.
120A copy of the NUL-terminated
121.Fa name
122is stored in the new
123.Vt RSA_METHOD
124object.
125Any new
126.Vt RSA
127object constructed from this
128.Vt RSA_METHOD
129will have the given
130.Fa flags
131set by default.
132.Pp
133.Fn RSA_meth_dup
134creates a deep copy of
135.Fa meth .
136This might be useful for creating a new
137.Vt RSA_METHOD
138based on an existing one, but with some differences.
139.Pp
140.Fn RSA_meth_free
141destroys
142.Fa meth
143and frees any memory associated with it.
144.Pp
145.Fn RSA_meth_set_finish
146sets an optional function for destroying an
147.Vt RSA
148object.
149Unless
150.Fa finish
151is
152.Dv NULL ,
153it will be called from
154.Xr RSA_free 3 .
155It takes the same argument
156and is intended to do RSA implementation specific cleanup.
157The memory used by the
158.Vt RSA
159object itself should not be freed by the
160.Fa finish
161function.
162.Pp
163.Fn RSA_meth_set_priv_enc
164and
165.Fn RSA_meth_set_priv_dec
166set the functions used for private key encryption and decryption.
167These functions will be called from
168.Xr RSA_private_decrypt 3
169and
170.Xr RSA_private_encrypt 3
171and take the same parameters as those.
172.Sh RETURN VALUES
173.Fn RSA_meth_new
174and
175.Fn RSA_meth_dup
176return the newly allocated
177.Vt RSA_METHOD
178object or
179.Dv NULL
180on failure.
181.Pp
182All
183.Fn RSA_meth_set_*
184functions return 1 on success or 0 on failure.
185.Sh SEE ALSO
186.Xr RSA_new 3 ,
187.Xr RSA_private_decrypt 3 ,
188.Xr RSA_private_encrypt 3 ,
189.Xr RSA_set_method 3
190.Sh HISTORY
191These functions first appeared in OpenSSL 1.1.0
192and have been available since
193.Ox 6.3 .