7 OSSL_SERIALIZER_up_ref,
9 OSSL_SERIALIZER_provider,
10 OSSL_SERIALIZER_properties,
12 OSSL_SERIALIZER_number,
13 OSSL_SERIALIZER_do_all_provided,
14 OSSL_SERIALIZER_names_do_all
15 - Serializer method routines
19 #include <openssl/serializer.h>
21 typedef struct ossl_serializer_st OSSL_SERIALIZER;
23 OSSL_SERIALIZER *OSSL_SERIALIZER_fetch(OPENSSL_CTX *ctx, const char *name,
24 const char *properties);
25 int OSSL_SERIALIZER_up_ref(OSSL_SERIALIZER *serializer);
26 void OSSL_SERIALIZER_free(OSSL_SERIALIZER *serializer);
27 const OSSL_PROVIDER *OSSL_SERIALIZER_provider(const OSSL_SERIALIZER
29 const char *OSSL_SERIALIZER_properties(const OSSL_SERIALIZER *ser);
30 int OSSL_SERIALIZER_is_a(const OSSL_SERIALIZER *serializer,
32 int OSSL_SERIALIZER_number(const OSSL_SERIALIZER *serializer);
33 void OSSL_SERIALIZER_do_all_provided(OPENSSL_CTX *libctx,
34 void (*fn)(OSSL_SERIALIZER *serializer,
37 void OSSL_SERIALIZER_names_do_all(const OSSL_SERIALIZER *serializer,
38 void (*fn)(const char *name, void *data),
43 =for comment Future development should also talk about deserialization
45 B<OSSL_SERIALIZER> is a method for serializers, which know how to
46 serialize an object of some kind to a serialized form, such as PEM,
47 DER, or even human readable text.
49 OSSL_SERIALIZER_fetch() looks for an algorithm within the provider that
50 has been loaded into the B<OPENSSL_CTX> given by I<ctx>, having the
51 name given by I<name> and the properties given by I<properties>.
52 The I<name> determines what type of object the fetched serializer
53 method is expected to be able to serialize, and the properties are
54 used to determine the expected output type.
55 For known properties and the values they may have, please have a look
56 in L<provider-serializer(7)/Names and properties>.
58 OSSL_SERIALIZER_up_ref() increments the reference count for the given
61 OSSL_SERIALIZER_free() decrements the reference count for the given
62 I<serializer>, and when the count reaches zero, frees it.
64 OSSL_SERIALIZER_provider() returns the provider of the given
67 OSSL_SERIALIZER_provider() returns the property definition associated
68 with the given I<serializer>.
70 OSSL_SERIALIZER_is_a() checks if I<serializer> is an implementation of an
71 algorithm that's identifiable with I<name>.
73 OSSL_SERIALIZER_number() returns the internal dynamic number assigned to
74 the given I<serializer>.
76 OSSL_SERIALIZER_names_do_all() traverses all names for the given
77 I<serializer>, and calls I<fn> with each name and I<data>.
79 OSSL_SERIALIZER_do_all_provided() traverses all serializer
80 implementations by all activated providers in the library context
81 I<libctx>, and for each of the implementations, calls I<fn> with the
82 implementation method and I<data> as arguments.
86 OSSL_SERIALIZER_fetch() may be called implicitly by other fetching
87 functions, using the same library context and properties.
88 Any other API that uses keys will typically do this.
92 OSSL_SERIALIZER_fetch() returns a pointer to the key management
93 implementation represented by an OSSL_SERIALIZER object, or NULL on
96 OSSL_SERIALIZER_up_ref() returns 1 on success, or 0 on error.
98 OSSL_SERIALIZER_free() doesn't return any value.
100 OSSL_SERIALIZER_provider() returns a pointer to a provider object, or
103 OSSL_SERIALIZER_properties() returns a pointer to a property
104 definition string, or NULL on error.
106 OSSL_SERIALIZER_is_a() returns 1 of I<serializer> was identifiable,
109 OSSL_SERIALIZER_number() returns an integer.
113 L<provider(7)>, L<OSSL_SERIALIZER_CTX(3)>, L<OSSL_SERIALIZER_to_bio(3)>,
114 L<OSSL_SERIALIZER_CTX_new_by_EVP_PKEY(3)>, L<OPENSSL_CTX(3)>
118 The functions described here were added in OpenSSL 3.0.
122 Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
124 Licensed under the Apache License 2.0 (the "License"). You may not use
125 this file except in compliance with the License. You can obtain a copy
126 in the file LICENSE in the source distribution or at
127 L<https://www.openssl.org/source/license.html>.