10 OSSL_ENCODER_properties,
13 OSSL_ENCODER_do_all_provided,
14 OSSL_ENCODER_names_do_all
15 - Encoder method routines
19 #include <openssl/encoder.h>
21 typedef struct ossl_encoder_st OSSL_ENCODER;
23 OSSL_ENCODER *OSSL_ENCODER_fetch(OPENSSL_CTX *ctx, const char *name,
24 const char *properties);
25 int OSSL_ENCODER_up_ref(OSSL_ENCODER *encoder);
26 void OSSL_ENCODER_free(OSSL_ENCODER *encoder);
27 const OSSL_PROVIDER *OSSL_ENCODER_provider(const OSSL_ENCODER *encoder);
28 const char *OSSL_ENCODER_properties(const OSSL_ENCODER *encoder);
29 int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name);
30 int OSSL_ENCODER_number(const OSSL_ENCODER *encoder);
31 void OSSL_ENCODER_do_all_provided(OPENSSL_CTX *libctx,
32 void (*fn)(OSSL_ENCODER *encoder, void *arg),
34 void OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder,
35 void (*fn)(const char *name, void *data),
40 =for comment Future development should also talk about decoding
42 B<OSSL_ENCODER> is a method for encoders, which know how to
43 encode an object of some kind to a encoded form, such as PEM,
44 DER, or even human readable text.
46 OSSL_ENCODER_fetch() looks for an algorithm within the provider that
47 has been loaded into the B<OPENSSL_CTX> given by I<ctx>, having the
48 name given by I<name> and the properties given by I<properties>.
49 The I<name> determines what type of object the fetched encoder
50 method is expected to be able to encode, and the properties are
51 used to determine the expected output type.
52 For known properties and the values they may have, please have a look
53 in L<provider-encoder(7)/Names and properties>.
55 OSSL_ENCODER_up_ref() increments the reference count for the given
58 OSSL_ENCODER_free() decrements the reference count for the given
59 I<encoder>, and when the count reaches zero, frees it.
61 OSSL_ENCODER_provider() returns the provider of the given
64 OSSL_ENCODER_provider() returns the property definition associated
65 with the given I<encoder>.
67 OSSL_ENCODER_is_a() checks if I<encoder> is an implementation of an
68 algorithm that's identifiable with I<name>.
70 OSSL_ENCODER_number() returns the internal dynamic number assigned to
73 OSSL_ENCODER_names_do_all() traverses all names for the given
74 I<encoder>, and calls I<fn> with each name and I<data>.
76 OSSL_ENCODER_do_all_provided() traverses all encoder
77 implementations by all activated providers in the library context
78 I<libctx>, and for each of the implementations, calls I<fn> with the
79 implementation method and I<data> as arguments.
83 OSSL_ENCODER_fetch() may be called implicitly by other fetching
84 functions, using the same library context and properties.
85 Any other API that uses keys will typically do this.
89 OSSL_ENCODER_fetch() returns a pointer to the key management
90 implementation represented by an OSSL_ENCODER object, or NULL on
93 OSSL_ENCODER_up_ref() returns 1 on success, or 0 on error.
95 OSSL_ENCODER_free() doesn't return any value.
97 OSSL_ENCODER_provider() returns a pointer to a provider object, or
100 OSSL_ENCODER_properties() returns a pointer to a property
101 definition string, or NULL on error.
103 OSSL_ENCODER_is_a() returns 1 of I<encoder> was identifiable,
106 OSSL_ENCODER_number() returns an integer.
110 L<provider(7)>, L<OSSL_ENCODER_CTX(3)>, L<OSSL_ENCODER_to_bio(3)>,
111 L<OSSL_ENCODER_CTX_new_by_EVP_PKEY(3)>, L<OPENSSL_CTX(3)>
115 The functions described here were added in OpenSSL 3.0.
119 Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
121 Licensed under the Apache License 2.0 (the "License"). You may not use
122 this file except in compliance with the License. You can obtain a copy
123 in the file LICENSE in the source distribution or at
124 L<https://www.openssl.org/source/license.html>.