10 OSSL_ENCODER_properties,
13 OSSL_ENCODER_do_all_provided,
14 OSSL_ENCODER_names_do_all,
15 OSSL_ENCODER_gettable_params,
16 OSSL_ENCODER_get_params
17 - Encoder method routines
21 #include <openssl/encoder.h>
23 typedef struct ossl_encoder_st OSSL_ENCODER;
25 OSSL_ENCODER *OSSL_ENCODER_fetch(OSSL_LIB_CTX *ctx, const char *name,
26 const char *properties);
27 int OSSL_ENCODER_up_ref(OSSL_ENCODER *encoder);
28 void OSSL_ENCODER_free(OSSL_ENCODER *encoder);
29 const OSSL_PROVIDER *OSSL_ENCODER_provider(const OSSL_ENCODER *encoder);
30 const char *OSSL_ENCODER_properties(const OSSL_ENCODER *encoder);
31 int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name);
32 int OSSL_ENCODER_number(const OSSL_ENCODER *encoder);
33 void OSSL_ENCODER_do_all_provided(OSSL_LIB_CTX *libctx,
34 void (*fn)(OSSL_ENCODER *encoder, void *arg),
36 int OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder,
37 void (*fn)(const char *name, void *data),
39 const OSSL_PARAM *OSSL_ENCODER_gettable_params(OSSL_ENCODER *encoder);
40 int OSSL_ENCODER_get_params(OSSL_ENCODER_CTX *ctx, const OSSL_PARAM params[]);
44 B<OSSL_ENCODER> is a method for encoders, which know how to
45 encode an object of some kind to a encoded form, such as PEM,
46 DER, or even human readable text.
48 OSSL_ENCODER_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 encoder
52 method is expected to be able to encode, 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_ENCODER_up_ref() increments the reference count for the given
60 OSSL_ENCODER_free() decrements the reference count for the given
61 I<encoder>, and when the count reaches zero, frees it.
63 OSSL_ENCODER_provider() returns the provider of the given
66 OSSL_ENCODER_properties() returns the property definition associated
67 with the given I<encoder>.
69 OSSL_ENCODER_is_a() checks if I<encoder> is an implementation of an
70 algorithm that's identifiable with I<name>.
72 OSSL_ENCODER_number() returns the internal dynamic number assigned to
75 OSSL_ENCODER_names_do_all() traverses all names for the given
76 I<encoder>, and calls I<fn> with each name and I<data> as arguments.
78 OSSL_ENCODER_do_all_provided() traverses all encoder
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_ENCODER_gettable_params() returns an L<OSSL_PARAM(3)>
84 array of parameter descriptors.
86 OSSL_ENCODER_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_ENCODER_fetch() returns a pointer to the key management
93 implementation represented by an OSSL_ENCODER object, or NULL on
96 OSSL_ENCODER_up_ref() returns 1 on success, or 0 on error.
98 OSSL_ENCODER_free() doesn't return any value.
100 OSSL_ENCODER_provider() returns a pointer to a provider object, or
103 OSSL_ENCODER_properties() returns a pointer to a property
104 definition string, or NULL on error.
106 OSSL_ENCODER_is_a() returns 1 of I<encoder> was identifiable,
109 OSSL_ENCODER_number() returns an integer.
111 OSSL_ENCODER_names_do_all() returns 1 if the callback was called for all
112 names. A return value of 0 means that the callback was not called for any names.
116 L<provider(7)>, L<OSSL_ENCODER_CTX(3)>, L<OSSL_ENCODER_to_bio(3)>,
117 L<OSSL_ENCODER_CTX_new_for_pkey(3)>, L<OSSL_LIB_CTX(3)>
121 The functions described here were added in OpenSSL 3.0.
125 Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
127 Licensed under the Apache License 2.0 (the "License"). You may not use
128 this file except in compliance with the License. You can obtain a copy
129 in the file LICENSE in the source distribution or at
130 L<https://www.openssl.org/source/license.html>.