1OSSL_ENCODER(3ossl)                 OpenSSL                OSSL_ENCODER(3ossl)
2
3
4

NAME

6       OSSL_ENCODER, OSSL_ENCODER_fetch, OSSL_ENCODER_up_ref,
7       OSSL_ENCODER_free, OSSL_ENCODER_get0_provider,
8       OSSL_ENCODER_get0_properties, OSSL_ENCODER_is_a,
9       OSSL_ENCODER_get0_name, OSSL_ENCODER_get0_description,
10       OSSL_ENCODER_do_all_provided, OSSL_ENCODER_names_do_all,
11       OSSL_ENCODER_gettable_params, OSSL_ENCODER_get_params - Encoder method
12       routines
13

SYNOPSIS

15        #include <openssl/encoder.h>
16
17        typedef struct ossl_encoder_st OSSL_ENCODER;
18
19        OSSL_ENCODER *OSSL_ENCODER_fetch(OSSL_LIB_CTX *ctx, const char *name,
20                                         const char *properties);
21        int OSSL_ENCODER_up_ref(OSSL_ENCODER *encoder);
22        void OSSL_ENCODER_free(OSSL_ENCODER *encoder);
23        const OSSL_PROVIDER *OSSL_ENCODER_get0_provider(const OSSL_ENCODER *encoder);
24        const char *OSSL_ENCODER_get0_properties(const OSSL_ENCODER *encoder);
25        int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name);
26        const char *OSSL_ENCODER_get0_name(const OSSL_ENCODER *encoder);
27        const char *OSSL_ENCODER_get0_description(const OSSL_ENCODER *encoder);
28        void OSSL_ENCODER_do_all_provided(OSSL_LIB_CTX *libctx,
29                                          void (*fn)(OSSL_ENCODER *encoder, void *arg),
30                                          void *arg);
31        int OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder,
32                                      void (*fn)(const char *name, void *data),
33                                      void *data);
34        const OSSL_PARAM *OSSL_ENCODER_gettable_params(OSSL_ENCODER *encoder);
35        int OSSL_ENCODER_get_params(OSSL_ENCODER_CTX *ctx, const OSSL_PARAM params[]);
36

DESCRIPTION

38       OSSL_ENCODER is a method for encoders, which know how to encode an
39       object of some kind to a encoded form, such as PEM, DER, or even human
40       readable text.
41
42       OSSL_ENCODER_fetch() looks for an algorithm within the provider that
43       has been loaded into the OSSL_LIB_CTX given by ctx, having the name
44       given by name and the properties given by properties.  The name
45       determines what type of object the fetched encoder method is expected
46       to be able to encode, and the properties are used to determine the
47       expected output type.  For known properties and the values they may
48       have, please have a look in "Names and properties" in
49       provider-encoder(7).
50
51       OSSL_ENCODER_up_ref() increments the reference count for the given
52       encoder.
53
54       OSSL_ENCODER_free() decrements the reference count for the given
55       encoder, and when the count reaches zero, frees it.
56
57       OSSL_ENCODER_get0_provider() returns the provider of the given encoder.
58
59       OSSL_ENCODER_get0_properties() returns the property definition
60       associated with the given encoder.
61
62       OSSL_ENCODER_is_a() checks if encoder is an implementation of an
63       algorithm that's identifiable with name.
64
65       OSSL_ENCODER_get0_name() returns the name used to fetch the given
66       encoder.
67
68       OSSL_ENCODER_get0_description() returns a description of the loader,
69       meant for display and human consumption.  The description is at the
70       discretion of the loader implementation.
71
72       OSSL_ENCODER_names_do_all() traverses all names for the given encoder,
73       and calls fn with each name and data as arguments.
74
75       OSSL_ENCODER_do_all_provided() traverses all encoder implementations by
76       all activated providers in the library context libctx, and for each of
77       the implementations, calls fn with the implementation method and arg as
78       arguments.
79
80       OSSL_ENCODER_gettable_params() returns an OSSL_PARAM(3) array of
81       parameter descriptors.
82
83       OSSL_ENCODER_get_params() attempts to get parameters specified with an
84       OSSL_PARAM(3) array params.  Parameters that the implementation doesn't
85       recognise should be ignored.
86

RETURN VALUES

88       OSSL_ENCODER_fetch() returns a pointer to the key management
89       implementation represented by an OSSL_ENCODER object, or NULL on error.
90
91       OSSL_ENCODER_up_ref() returns 1 on success, or 0 on error.
92
93       OSSL_ENCODER_free() doesn't return any value.
94
95       OSSL_ENCODER_get0_provider() returns a pointer to a provider object, or
96       NULL on error.
97
98       OSSL_ENCODER_get0_properties() returns a pointer to a property
99       definition string, or NULL on error.
100
101       OSSL_ENCODER_is_a() returns 1 of encoder was identifiable, otherwise 0.
102
103       OSSL_ENCODER_get0_name() returns the algorithm name from the provided
104       implementation for the given encoder. Note that the encoder may have
105       multiple synonyms associated with it. In this case the first name from
106       the algorithm definition is returned. Ownership of the returned string
107       is retained by the encoder object and should not be freed by the
108       caller.
109
110       OSSL_ENCODER_get0_description() returns a pointer to a decription, or
111       NULL if there isn't one.
112
113       OSSL_ENCODER_names_do_all() returns 1 if the callback was called for
114       all names. A return value of 0 means that the callback was not called
115       for any names.
116

SEE ALSO

118       provider(7), OSSL_ENCODER_CTX(3), OSSL_ENCODER_to_bio(3),
119       OSSL_ENCODER_CTX_new_for_pkey(3), OSSL_LIB_CTX(3)
120

HISTORY

122       The functions described here were added in OpenSSL 3.0.
123
125       Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
126
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       <https://www.openssl.org/source/license.html>.
131
132
133
1343.0.5                             2022-11-01               OSSL_ENCODER(3ossl)
Impressum