6 OSSL_DESERIALIZER_fetch,
7 OSSL_DESERIALIZER_up_ref,
8 OSSL_DESERIALIZER_free,
9 OSSL_DESERIALIZER_provider,
10 OSSL_DESERIALIZER_properties,
11 OSSL_DESERIALIZER_is_a,
12 OSSL_DESERIALIZER_number,
13 OSSL_DESERIALIZER_do_all_provided,
14 OSSL_DESERIALIZER_names_do_all,
15 OSSL_DESERIALIZER_gettable_params,
16 OSSL_DESERIALIZER_get_params
17 - Deserializer method routines
21 #include <openssl/deserializer.h>
23 typedef struct ossl_deserializer_st OSSL_DESERIALIZER;
25 OSSL_DESERIALIZER *OSSL_DESERIALIZER_fetch(OPENSSL_CTX *ctx, const char *name,
26 const char *properties);
27 int OSSL_DESERIALIZER_up_ref(OSSL_DESERIALIZER *deserializer);
28 void OSSL_DESERIALIZER_free(OSSL_DESERIALIZER *deserializer);
29 const OSSL_PROVIDER *OSSL_DESERIALIZER_provider(const OSSL_DESERIALIZER
31 const char *OSSL_DESERIALIZER_properties(const OSSL_DESERIALIZER *deser);
32 int OSSL_DESERIALIZER_is_a(const OSSL_DESERIALIZER *deserializer,
34 int OSSL_DESERIALIZER_number(const OSSL_DESERIALIZER *deserializer);
35 void OSSL_DESERIALIZER_do_all_provided(OPENSSL_CTX *libctx,
36 void (*fn)(OSSL_DESERIALIZER *deserializer,
39 void OSSL_DESERIALIZER_names_do_all(const OSSL_DESERIALIZER *deserializer,
40 void (*fn)(const char *name, void *data),
42 const OSSL_PARAM *OSSL_DESERIALIZER_gettable_params(OSSL_DESERIALIZER *deser);
43 int OSSL_DESERIALIZER_get_params(OSSL_DESERIALIZER_CTX *ctx,
44 const OSSL_PARAM params[]);
48 B<OSSL_DESERIALIZER> is a method for deserializers, which know how to
49 deserialize serialized data into an object of some type that the rest
50 of OpenSSL knows how to handle.
52 OSSL_DESERIALIZER_fetch() looks for an algorithm within the provider that
53 has been loaded into the B<OPENSSL_CTX> given by I<ctx>, having the
54 name given by I<name> and the properties given by I<properties>.
55 The I<name> determines what type of object the fetched deserializer
56 method is expected to be able to deserialize, and the properties are
57 used to determine the expected output type.
58 For known properties and the values they may have, please have a look
59 in L<provider-serializer(7)/Names and properties>.
61 OSSL_DESERIALIZER_up_ref() increments the reference count for the given
64 OSSL_DESERIALIZER_free() decrements the reference count for the given
65 I<deserializer>, and when the count reaches zero, frees it.
67 OSSL_DESERIALIZER_provider() returns the provider of the given
70 OSSL_DESERIALIZER_properties() returns the property definition associated
71 with the given I<deserializer>.
73 OSSL_DESERIALIZER_is_a() checks if I<deserializer> is an implementation
74 of an algorithm that's identifiable with I<name>.
76 OSSL_DESERIALIZER_number() returns the internal dynamic number assigned
77 to the given I<deserializer>.
79 OSSL_DESERIALIZER_names_do_all() traverses all names for the given
80 I<deserializer>, and calls I<fn> with each name and I<data>.
82 OSSL_DESERIALIZER_do_all_provided() traverses all serializer
83 implementations by all activated providers in the library context
84 I<libctx>, and for each of the implementations, calls I<fn> with the
85 implementation method and I<data> as arguments.
87 OSSL_DESERIALIZER_gettable_params() returns an L<OSSL_PARAM(3)>
88 array of parameter descriptors.
90 OSSL_DESERIALIZER_get_params() attempts to get parameters specified
91 with an L<OSSL_PARAM(3)> array I<params>. Parameters that the
92 implementation doesn't recognise should be ignored.
96 OSSL_DESERIALIZER_fetch() returns a pointer to an OSSL_DESERIALIZER object,
99 OSSL_DESERIALIZER_up_ref() returns 1 on success, or 0 on error.
101 OSSL_DESERIALIZER_free() doesn't return any value.
103 OSSL_DESERIALIZER_provider() returns a pointer to a provider object, or
106 OSSL_DESERIALIZER_properties() returns a pointer to a property
107 definition string, or NULL on error.
109 OSSL_DESERIALIZER_is_a() returns 1 if I<deserializer> was identifiable,
112 OSSL_DESERIALIZER_number() returns an integer.
116 OSSL_DESERIALIZER_fetch() may be called implicitly by other fetching
117 functions, using the same library context and properties.
118 Any other API that uses keys will typically do this.
120 =begin comment TODO(3.0) Add examples!
124 Text, because pod2xxx doesn't like empty sections
130 L<provider(7)>, L<OSSL_DESERIALIZER_CTX(3)>, L<OSSL_DESERIALIZER_from_bio(3)>,
131 L<OSSL_DESERIALIZER_CTX_new_by_EVP_PKEY(3)>, L<OPENSSL_CTX(3)>
135 The functions described here were added in OpenSSL 3.0.
139 Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
141 Licensed under the Apache License 2.0 (the "License"). You may not use
142 this file except in compliance with the License. You can obtain a copy
143 in the file LICENSE in the source distribution or at
144 L<https://www.openssl.org/source/license.html>.