2 * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include <openssl/core_numbers.h>
11 #include <openssl/types.h>
12 #include "internal/cryptlib.h"
13 #include "internal/refcount.h"
15 struct ossl_serializer_st {
20 CRYPTO_REF_COUNT refcnt;
23 OSSL_OP_serializer_newctx_fn *newctx;
24 OSSL_OP_serializer_freectx_fn *freectx;
25 OSSL_OP_serializer_set_ctx_params_fn *set_ctx_params;
26 OSSL_OP_serializer_settable_ctx_params_fn *settable_ctx_params;
27 OSSL_OP_serializer_serialize_data_fn *serialize_data;
28 OSSL_OP_serializer_serialize_object_fn *serialize_object;
31 struct ossl_serializer_ctx_st {
38 * |object| is the libcrypto object to handle.
39 * |do_output| must have intimate knowledge of this object.
42 int (*do_output)(OSSL_SERIALIZER_CTX *ctx, BIO *out);
44 /* For any function that needs a passphrase reader */
45 const UI_METHOD *ui_method;
48 * if caller used OSSL_SERIALIZER_CTX_set_passphrase_cb(), we need
49 * intermediary storage.
51 UI_METHOD *allocated_ui_method;