]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/OSSL_SERIALIZER_CTX.pod
Rename OSSL_SERIALIZER / OSSL_DESERIALIZER to OSSL_ENCODE / OSSL_DECODE
[thirdparty/openssl.git] / doc / man3 / OSSL_SERIALIZER_CTX.pod
CommitLineData
0d003c52
RL
1=pod
2
3=head1 NAME
4
5OSSL_SERIALIZER_CTX,
6OSSL_SERIALIZER_CTX_new,
7OSSL_SERIALIZER_CTX_get_serializer,
8OSSL_SERIALIZER_settable_ctx_params,
9OSSL_SERIALIZER_CTX_set_params,
10OSSL_SERIALIZER_CTX_free
11- Serializer context routines
12
13=head1 SYNOPSIS
14
15 #include <openssl/serializer.h>
16
17 typedef struct ossl_serializer_ctx_st OSSL_SERIALIZER_CTX;
18
19 OSSL_SERIALIZER_CTX *OSSL_SERIALIZER_CTX_new(OSSL_SERIALIZER *ser);
20 const OSSL_SERIALIZER *
21 OSSL_SERIALIZER_CTX_get_serializer(OSSL_SERIALIZER_CTX *ctx);
22 const OSSL_PARAM *OSSL_SERIALIZER_settable_ctx_params(OSSL_SERIALIZER *ser);
23 int OSSL_SERIALIZER_CTX_set_params(OSSL_SERIALIZER_CTX *ctx,
24 const OSSL_PARAM params[]);
25 void OSSL_SERIALIZER_CTX_free(OSSL_SERIALIZER_CTX *ctx);
26
27=head1 DESCRIPTION
28
29B<OSSL_SERIALIZER_CTX> is a context with which B<OSSL_SERIALIZER>
30operations are performed. The context typically holds values, both
31internal and supplied by the application, which are useful for the
32implementations supplied by providers.
33
34OSSL_SERIALIZER_CTX_new() creates a B<OSSL_SERIALIZER_CTX> associated
35with the serializer I<ser>. NULL is a valid I<ser>, the context will
36be created anyway, it's just not very useful. This is intentional, to
37distinguish between errors in allocating the context or assigning it
38values on one hand, and the lack of serializer support on the other.
39
40=begin comment
41
42The above distinction makes it possible for other routines to sense if
43they need to report an error or fall back on other methods to
44serialize.
45
46=end comment
47
48OSSL_SERIALIZER_CTX_get_serializer() gets the serializer method
49currently associated with the context I<ctx>.
50
51OSSL_SERIALIZER_settable_ctx_params() returns an L<OSSL_PARAM(3)>
52array of parameter descriptors.
53
54OSSL_SERIALIZER_CTX_set_params() attempts to set parameters specified
55with an L<OSSL_PARAM(3)> array I<params>. Parameters that the
56implementation doesn't recognise should be ignored.
57
58OSSL_SERIALIZER_CTX_free() frees the given context I<ctx>.
59
60=head1 RETURN VALUES
61
62OSSL_SERIALIZER_CTX_new() returns a pointer to a
63B<OSSL_SERIALIZER_CTX>, or NULL if the context structure couldn't be
64allocated.
65
66OSSL_SERIALIZER_CTX_get_serializer() returns a pointer to the
67serializer method associated with I<ctx>. NULL is a valid return
68value and signifies that there is no associated serializer method.
69
70OSSL_SERIALIZER_settable_ctx_params() returns an L<OSSL_PARAM(3)>
71array, or NULL if none is available.
72
73OSSL_SERIALIZER_CTX_set_params() returns 1 if all recognised
74parameters were valid, or 0 if one of them was invalid or caused some
75other failure in the implementation.
76
77=head1 SEE ALSO
78
79L<provider(7)>, L<OSSL_SERIALIZER(3)>
80
81=head1 HISTORY
82
83The functions described here were added in OpenSSL 3.0.
84
85=head1 COPYRIGHT
86
87Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
88
89Licensed under the Apache License 2.0 (the "License"). You may not use
90this file except in compliance with the License. You can obtain a copy
91in the file LICENSE in the source distribution or at
92L<https://www.openssl.org/source/license.html>.
93
94=cut