]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man7/openssl-core.h.pod
SERIALIZER: New API for serialization of objects through providers
[thirdparty/openssl.git] / doc / man7 / openssl-core.h.pod
CommitLineData
7753be74
RL
1=pod
2
3=head1 NAME
4
5openssl/core.h - OpenSSL Core types
6
7=head1 SYNOPSIS
8
9 #include <openssl/core.h>
10
11=head1 DESCRIPTION
12
d7cea0b8 13The F<< <openssl/core.h> >> header defines a number of public types that
7753be74
RL
14are used to communicate between the OpenSSL libraries and
15implementation providers.
16These types are designed to minimise the need for intimate knowledge
17of internal structures between the OpenSSL libraries and the providers.
18
19The types are:
20
21=over 4
22
dfabee82 23=item B<OSSL_DISPATCH>
7753be74
RL
24
25This type is a tuple of function identity and function pointer.
26Arrays of this type are passed between the OpenSSL libraries and the
27providers to describe what functionality one side provides to the
28other.
29Arrays of this type must be terminated with a tuple having function
dfabee82 30identity zero and function pointer NULL.
7753be74
RL
31
32The available function identities and corresponding function
d7cea0b8 33signatures are defined in L<openssl-core_numbers.h(7)>.
7753be74
RL
34
35Any function identity not recognised by the recipient of this type
36will be ignored.
37This ensures that providers built with one OpenSSL version in mind
38will work together with any other OpenSSL version that supports this
39mechanism.
40
dfabee82 41=item B<OSSL_ITEM>
7753be74
RL
42
43This type is a tuple of integer and pointer.
44It's a generic type used as a generic descriptor, its exact meaning
45being defined by how it's used.
46Arrays of this type are passed between the OpenSSL libraries and the
47providers, and must be terminated with a tuple where the integer is
dfabee82 48zero and the pointer NULL.
7753be74 49
dfabee82 50=item B<OSSL_ALGORITHM>
7753be74
RL
51
52This type is a tuple of an algorithm name (string), a property
dfabee82 53definition (string) and a dispatch table (array of B<OSSL_DISPATCH>).
7753be74
RL
54Arrays of this type are passed on demand from the providers to the
55OpenSSL libraries to describe what algorithms the providers provide
56implementations of, and with what properties.
57Arrays of this type must be terminated with a tuple having function
dfabee82 58identity zero and function pointer NULL.
7753be74
RL
59
60The algorithm names and property definitions are defined by the
61providers.
62
dfabee82 63=item B<OSSL_PARAM>
7753be74
RL
64
65This type is a structure that allows passing arbitrary object data
66between two parties that have no or very little shared knowledge about
67their respective internal structures for that object.
68It's normally passed in arrays, where the array is terminated with an
dfabee82 69element where all fields are zero (for non-pointers) or NULL (for
7753be74
RL
70pointers).
71
3efe1914
RL
72These arrays can be used to set parameters for some object, to request
73parameters, and to describe parameters.
7753be74 74
dfabee82 75B<OSSL_PARAM> is further described in L<OSSL_PARAM(3)>
7753be74 76
10e7216e
RL
77=item B<OSSL_CALLBACK>
78
0d003c52 79This is a function type for a generic feedback callback function:
10e7216e
RL
80
81 typedef int (OSSL_CALLBACK)(const OSSL_PARAM params[], void *arg);
82
83A function that takes a pointer of this type should also take a
84pointer to caller data. When calling this callback, the function is
85expected to build an B<OSSL_PARAM> array of data it wants or is
86expected to pass back, and pass that as I<params>, as well as
87the caller data pointer it received, as I<arg>.
88
0d003c52
RL
89=item B<OSSL_PASSPHRASE_CALLBACK>
90
91This is a function type for a generic pass phrase callback function:
92
93 typedef int (OSSL_PASSPHRASE_CALLBACK)(char *pass, size_t pass_size,
94 size_t *pass_len,
95 const OSSL_PARAM params[],
96 void *arg);
97
98This callback can be used to prompt the user for a passphrase. When
99calling it, a buffer to store the pass phrase needs to be given with
100I<pass>, and its size with I<pass_size>. The length of the prompted
101pass phrase will be given back in I<*pass_len>.
102
103Additional parameters can be passed with the B<OSSL_PARAM> array
104I<params>.
105
106A function that takes a pointer of this type should also take a
107pointer to caller data, which should be passed as I<arg> to this
108callback.
109
7753be74
RL
110=back
111
112=head1 SEE ALSO
113
114L<openssl-core_numbers.h(7)>
115
116=head1 HISTORY
117
118The types described here were added in OpenSSL 3.0.
119
120=head1 COPYRIGHT
121
122Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
123
124Licensed under the Apache License 2.0 (the "License"). You may not use
125this file except in compliance with the License. You can obtain a copy
126in the file LICENSE in the source distribution or at
127L<https://www.openssl.org/source/license.html>.
128
129=cut