10 OSSL_DECODER_properties,
13 OSSL_DECODER_do_all_provided,
14 OSSL_DECODER_names_do_all,
15 OSSL_DECODER_gettable_params,
16 OSSL_DECODER_get_params
17 - Decoder method routines
21 #include <openssl/decoder.h>
23 typedef struct ossl_decoder_st OSSL_DECODER;
25 OSSL_DECODER *OSSL_DECODER_fetch(OSSL_LIB_CTX *ctx, const char *name,
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);
33 void OSSL_DECODER_do_all_provided(OSSL_LIB_CTX *libctx,
34 void (*fn)(OSSL_DECODER *decoder, void *arg),
36 void OSSL_DECODER_names_do_all(const OSSL_DECODER *decoder,
37 void (*fn)(const char *name, 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[]);
44 B<OSSL_DECODER> is a method for decoders, which know how to
45 decode encoded data into an object of some type that the rest
46 of OpenSSL knows how to handle.
48 OSSL_DECODER_fetch() looks for an algorithm within the provider that
49 has been loaded into the B<OSSL_LIB_CTX> given by I<ctx>, having the
50 name given by I<name> and the properties given by I<properties>.
51 The I<name> determines what type of object the fetched decoder
52 method is expected to be able to decode, and the properties are
53 used to determine the expected output type.
54 For known properties and the values they may have, please have a look
55 in L<provider-encoder(7)/Names and properties>.
57 OSSL_DECODER_up_ref() increments the reference count for the given
60 OSSL_DECODER_free() decrements the reference count for the given
61 I<decoder>, and when the count reaches zero, frees it.
63 OSSL_DECODER_provider() returns the provider of the given
66 OSSL_DECODER_properties() returns the property definition associated
67 with the given I<decoder>.
69 OSSL_DECODER_is_a() checks if I<decoder> is an implementation
70 of an algorithm that's identifiable with I<name>.
72 OSSL_DECODER_number() returns the internal dynamic number assigned
73 to the given I<decoder>.
75 OSSL_DECODER_names_do_all() traverses all names for the given
76 I<decoder>, and calls I<fn> with each name and I<data> as arguments.
78 OSSL_DECODER_do_all_provided() traverses all decoder
79 implementations by all activated providers in the library context
80 I<libctx>, and for each of the implementations, calls I<fn> with the
81 implementation method and I<arg> as arguments.
83 OSSL_DECODER_gettable_params() returns an L<OSSL_PARAM(3)>
84 array of parameter descriptors.
86 OSSL_DECODER_get_params() attempts to get parameters specified
87 with an L<OSSL_PARAM(3)> array I<params>. Parameters that the
88 implementation doesn't recognise should be ignored.
92 OSSL_DECODER_fetch() returns a pointer to an OSSL_DECODER object,
95 OSSL_DECODER_up_ref() returns 1 on success, or 0 on error.
97 OSSL_DECODER_free() doesn't return any value.
99 OSSL_DECODER_provider() returns a pointer to a provider object, or
102 OSSL_DECODER_properties() returns a pointer to a property
103 definition string, or NULL on error.
105 OSSL_DECODER_is_a() returns 1 if I<decoder> was identifiable,
108 OSSL_DECODER_number() returns an integer.
112 OSSL_DECODER_fetch() may be called implicitly by other fetching
113 functions, using the same library context and properties.
114 Any other API that uses keys will typically do this.
116 =begin comment TODO(3.0) Add examples!
120 Text, because pod2xxx doesn't like empty sections
126 L<provider(7)>, L<OSSL_DECODER_CTX(3)>, L<OSSL_DECODER_from_bio(3)>,
127 L<OSSL_DECODER_CTX_new_by_EVP_PKEY(3)>, L<OSSL_LIB_CTX(3)>
131 The functions described here were added in OpenSSL 3.0.
135 Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
137 Licensed under the Apache License 2.0 (the "License"). You may not use
138 this file except in compliance with the License. You can obtain a copy
139 in the file LICENSE in the source distribution or at
140 L<https://www.openssl.org/source/license.html>.