]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/OSSL_DECODER.pod
Rename OPENSSL_CTX prefix to OSSL_LIB_CTX
[thirdparty/openssl.git] / doc / man3 / OSSL_DECODER.pod
CommitLineData
ece9304c
RL
1=pod
2
3=head1 NAME
4
5OSSL_DECODER,
6OSSL_DECODER_fetch,
7OSSL_DECODER_up_ref,
8OSSL_DECODER_free,
9OSSL_DECODER_provider,
10OSSL_DECODER_properties,
11OSSL_DECODER_is_a,
12OSSL_DECODER_number,
13OSSL_DECODER_do_all_provided,
14OSSL_DECODER_names_do_all,
15OSSL_DECODER_gettable_params,
16OSSL_DECODER_get_params
17- Decoder method routines
18
19=head1 SYNOPSIS
20
21 #include <openssl/decoder.h>
22
23 typedef struct ossl_decoder_st OSSL_DECODER;
24
b4250010 25 OSSL_DECODER *OSSL_DECODER_fetch(OSSL_LIB_CTX *ctx, const char *name,
ece9304c
RL
26 const char *properties);
27 int OSSL_DECODER_up_ref(OSSL_DECODER *decoder);
28 void OSSL_DECODER_free(OSSL_DECODER *decoder);
29 const OSSL_PROVIDER *OSSL_DECODER_provider(const OSSL_DECODER *decoder);
30 const char *OSSL_DECODER_properties(const OSSL_DECODER *decoder);
31 int OSSL_DECODER_is_a(const OSSL_DECODER *decoder, const char *name);
32 int OSSL_DECODER_number(const OSSL_DECODER *decoder);
b4250010 33 void OSSL_DECODER_do_all_provided(OSSL_LIB_CTX *libctx,
ece9304c
RL
34 void (*fn)(OSSL_DECODER *decoder, void *arg),
35 void *arg);
36 void OSSL_DECODER_names_do_all(const OSSL_DECODER *decoder,
37 void (*fn)(const char *name, void *data),
38 void *data);
39 const OSSL_PARAM *OSSL_DECODER_gettable_params(OSSL_DECODER *decoder);
40 int OSSL_DECODER_get_params(OSSL_DECODER_CTX *ctx, const OSSL_PARAM params[]);
41
42=head1 DESCRIPTION
43
44B<OSSL_DECODER> is a method for decoders, which know how to
45decode encoded data into an object of some type that the rest
46of OpenSSL knows how to handle.
47
48OSSL_DECODER_fetch() looks for an algorithm within the provider that
b4250010 49has been loaded into the B<OSSL_LIB_CTX> given by I<ctx>, having the
ece9304c
RL
50name given by I<name> and the properties given by I<properties>.
51The I<name> determines what type of object the fetched decoder
52method is expected to be able to decode, and the properties are
53used to determine the expected output type.
54For known properties and the values they may have, please have a look
55in L<provider-encoder(7)/Names and properties>.
56
57OSSL_DECODER_up_ref() increments the reference count for the given
58I<decoder>.
59
60OSSL_DECODER_free() decrements the reference count for the given
61I<decoder>, and when the count reaches zero, frees it.
62
63OSSL_DECODER_provider() returns the provider of the given
64I<decoder>.
65
66OSSL_DECODER_properties() returns the property definition associated
67with the given I<decoder>.
68
69OSSL_DECODER_is_a() checks if I<decoder> is an implementation
70of an algorithm that's identifiable with I<name>.
71
72OSSL_DECODER_number() returns the internal dynamic number assigned
73to the given I<decoder>.
74
75OSSL_DECODER_names_do_all() traverses all names for the given
76I<decoder>, and calls I<fn> with each name and I<data>.
77
78OSSL_DECODER_do_all_provided() traverses all encoder
79implementations by all activated providers in the library context
80I<libctx>, and for each of the implementations, calls I<fn> with the
81implementation method and I<data> as arguments.
82
83OSSL_DECODER_gettable_params() returns an L<OSSL_PARAM(3)>
84array of parameter descriptors.
85
86OSSL_DECODER_get_params() attempts to get parameters specified
87with an L<OSSL_PARAM(3)> array I<params>. Parameters that the
88implementation doesn't recognise should be ignored.
89
90=head1 RETURN VALUES
91
92OSSL_DECODER_fetch() returns a pointer to an OSSL_DECODER object,
93or NULL on error.
94
95OSSL_DECODER_up_ref() returns 1 on success, or 0 on error.
96
97OSSL_DECODER_free() doesn't return any value.
98
99OSSL_DECODER_provider() returns a pointer to a provider object, or
100NULL on error.
101
102OSSL_DECODER_properties() returns a pointer to a property
103definition string, or NULL on error.
104
105OSSL_DECODER_is_a() returns 1 if I<decoder> was identifiable,
106otherwise 0.
107
108OSSL_DECODER_number() returns an integer.
109
110=head1 NOTES
111
112OSSL_DECODER_fetch() may be called implicitly by other fetching
113functions, using the same library context and properties.
114Any other API that uses keys will typically do this.
115
116=begin comment TODO(3.0) Add examples!
117
118=head1 EXAMPLES
119
120Text, because pod2xxx doesn't like empty sections
121
122=end comment
123
124=head1 SEE ALSO
125
126L<provider(7)>, L<OSSL_DECODER_CTX(3)>, L<OSSL_DECODER_from_bio(3)>,
b4250010 127L<OSSL_DECODER_CTX_new_by_EVP_PKEY(3)>, L<OSSL_LIB_CTX(3)>
ece9304c
RL
128
129=head1 HISTORY
130
131The functions described here were added in OpenSSL 3.0.
132
133=head1 COPYRIGHT
134
135Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
136
137Licensed under the Apache License 2.0 (the "License"). You may not use
138this file except in compliance with the License. You can obtain a copy
139in the file LICENSE in the source distribution or at
140L<https://www.openssl.org/source/license.html>.
141
142=cut