VirtualBox

source: vbox/trunk/src/libs/openssl-3.0.7/include/openssl/decoder.h@ 98133

最後變更 在這個檔案從98133是 94320,由 vboxsync 提交於 3 年 前

libs/openssl-3.0.1: Export to OSE and fix copyright headers in Makefiles, bugref:10128

檔案大小: 5.6 KB
 
1/*
2 * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
3 *
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
8 */
9
10#ifndef OPENSSL_DECODER_H
11# define OPENSSL_DECODER_H
12# pragma once
13
14# include <openssl/opensslconf.h>
15
16# ifndef OPENSSL_NO_STDIO
17# include <stdio.h>
18# endif
19# include <stdarg.h>
20# include <stddef.h>
21# include <openssl/decodererr.h>
22# include <openssl/types.h>
23# include <openssl/core.h>
24
25# ifdef __cplusplus
26extern "C" {
27# endif
28
29OSSL_DECODER *OSSL_DECODER_fetch(OSSL_LIB_CTX *libctx, const char *name,
30 const char *properties);
31int OSSL_DECODER_up_ref(OSSL_DECODER *encoder);
32void OSSL_DECODER_free(OSSL_DECODER *encoder);
33
34const OSSL_PROVIDER *OSSL_DECODER_get0_provider(const OSSL_DECODER *encoder);
35const char *OSSL_DECODER_get0_properties(const OSSL_DECODER *encoder);
36const char *OSSL_DECODER_get0_name(const OSSL_DECODER *decoder);
37const char *OSSL_DECODER_get0_description(const OSSL_DECODER *decoder);
38int OSSL_DECODER_is_a(const OSSL_DECODER *encoder, const char *name);
39
40void OSSL_DECODER_do_all_provided(OSSL_LIB_CTX *libctx,
41 void (*fn)(OSSL_DECODER *encoder, void *arg),
42 void *arg);
43int OSSL_DECODER_names_do_all(const OSSL_DECODER *encoder,
44 void (*fn)(const char *name, void *data),
45 void *data);
46const OSSL_PARAM *OSSL_DECODER_gettable_params(OSSL_DECODER *decoder);
47int OSSL_DECODER_get_params(OSSL_DECODER *decoder, OSSL_PARAM params[]);
48
49const OSSL_PARAM *OSSL_DECODER_settable_ctx_params(OSSL_DECODER *encoder);
50OSSL_DECODER_CTX *OSSL_DECODER_CTX_new(void);
51int OSSL_DECODER_CTX_set_params(OSSL_DECODER_CTX *ctx,
52 const OSSL_PARAM params[]);
53void OSSL_DECODER_CTX_free(OSSL_DECODER_CTX *ctx);
54
55/* Utilities that help set specific parameters */
56int OSSL_DECODER_CTX_set_passphrase(OSSL_DECODER_CTX *ctx,
57 const unsigned char *kstr, size_t klen);
58int OSSL_DECODER_CTX_set_pem_password_cb(OSSL_DECODER_CTX *ctx,
59 pem_password_cb *cb, void *cbarg);
60int OSSL_DECODER_CTX_set_passphrase_cb(OSSL_DECODER_CTX *ctx,
61 OSSL_PASSPHRASE_CALLBACK *cb,
62 void *cbarg);
63int OSSL_DECODER_CTX_set_passphrase_ui(OSSL_DECODER_CTX *ctx,
64 const UI_METHOD *ui_method,
65 void *ui_data);
66
67/*
68 * Utilities to read the object to decode, with the result sent to cb.
69 * These will discover all provided methods
70 */
71
72int OSSL_DECODER_CTX_set_selection(OSSL_DECODER_CTX *ctx, int selection);
73int OSSL_DECODER_CTX_set_input_type(OSSL_DECODER_CTX *ctx,
74 const char *input_type);
75int OSSL_DECODER_CTX_set_input_structure(OSSL_DECODER_CTX *ctx,
76 const char *input_structure);
77int OSSL_DECODER_CTX_add_decoder(OSSL_DECODER_CTX *ctx, OSSL_DECODER *decoder);
78int OSSL_DECODER_CTX_add_extra(OSSL_DECODER_CTX *ctx,
79 OSSL_LIB_CTX *libctx, const char *propq);
80int OSSL_DECODER_CTX_get_num_decoders(OSSL_DECODER_CTX *ctx);
81
82typedef struct ossl_decoder_instance_st OSSL_DECODER_INSTANCE;
83OSSL_DECODER *
84OSSL_DECODER_INSTANCE_get_decoder(OSSL_DECODER_INSTANCE *decoder_inst);
85void *
86OSSL_DECODER_INSTANCE_get_decoder_ctx(OSSL_DECODER_INSTANCE *decoder_inst);
87const char *
88OSSL_DECODER_INSTANCE_get_input_type(OSSL_DECODER_INSTANCE *decoder_inst);
89const char *
90OSSL_DECODER_INSTANCE_get_input_structure(OSSL_DECODER_INSTANCE *decoder_inst,
91 int *was_set);
92
93typedef int OSSL_DECODER_CONSTRUCT(OSSL_DECODER_INSTANCE *decoder_inst,
94 const OSSL_PARAM *params,
95 void *construct_data);
96typedef void OSSL_DECODER_CLEANUP(void *construct_data);
97
98int OSSL_DECODER_CTX_set_construct(OSSL_DECODER_CTX *ctx,
99 OSSL_DECODER_CONSTRUCT *construct);
100int OSSL_DECODER_CTX_set_construct_data(OSSL_DECODER_CTX *ctx,
101 void *construct_data);
102int OSSL_DECODER_CTX_set_cleanup(OSSL_DECODER_CTX *ctx,
103 OSSL_DECODER_CLEANUP *cleanup);
104OSSL_DECODER_CONSTRUCT *OSSL_DECODER_CTX_get_construct(OSSL_DECODER_CTX *ctx);
105void *OSSL_DECODER_CTX_get_construct_data(OSSL_DECODER_CTX *ctx);
106OSSL_DECODER_CLEANUP *OSSL_DECODER_CTX_get_cleanup(OSSL_DECODER_CTX *ctx);
107
108int OSSL_DECODER_export(OSSL_DECODER_INSTANCE *decoder_inst,
109 void *reference, size_t reference_sz,
110 OSSL_CALLBACK *export_cb, void *export_cbarg);
111
112int OSSL_DECODER_from_bio(OSSL_DECODER_CTX *ctx, BIO *in);
113#ifndef OPENSSL_NO_STDIO
114int OSSL_DECODER_from_fp(OSSL_DECODER_CTX *ctx, FILE *in);
115#endif
116int OSSL_DECODER_from_data(OSSL_DECODER_CTX *ctx, const unsigned char **pdata,
117 size_t *pdata_len);
118
119/*
120 * Create the OSSL_DECODER_CTX with an associated type. This will perform
121 * an implicit OSSL_DECODER_fetch(), suitable for the object of that type.
122 */
123OSSL_DECODER_CTX *
124OSSL_DECODER_CTX_new_for_pkey(EVP_PKEY **pkey,
125 const char *input_type,
126 const char *input_struct,
127 const char *keytype, int selection,
128 OSSL_LIB_CTX *libctx, const char *propquery);
129
130# ifdef __cplusplus
131}
132# endif
133#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette