STORE: Add a built-in 'file:' storemgmt implementation (loader)
[openssl.git] / include / crypto / decoder.h
1 /*
2  * Copyright 2020 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 OSSL_CRYPTO_DECODER_H
11 # define OSSL_CRYPTO_DECODER_H
12
13 # include <openssl/decoder.h>
14
15 OSSL_DECODER *ossl_decoder_fetch_by_number(OPENSSL_CTX *libctx,
16                                                      int id,
17                                                      const char *properties);
18
19 /*
20  * These are specially made for the 'file:' provider-native loader, which
21  * uses this to install a DER to anything decoder, which doesn't do much
22  * except read a DER blob and pass it on as a provider object abstraction
23  * (provider-object(7)).
24  */
25 void *ossl_decoder_from_dispatch(int id, const OSSL_ALGORITHM *algodef,
26                                  OSSL_PROVIDER *prov);
27
28 OSSL_DECODER_INSTANCE *
29 ossl_decoder_instance_new(OSSL_DECODER *decoder, void *decoderctx);
30 void ossl_decoder_instance_free(OSSL_DECODER_INSTANCE *decoder_inst);
31 int ossl_decoder_ctx_add_decoder_inst(OSSL_DECODER_CTX *ctx,
32                                       OSSL_DECODER_INSTANCE *di);
33
34 int ossl_decoder_ctx_setup_for_EVP_PKEY(OSSL_DECODER_CTX *ctx,
35                                         EVP_PKEY **pkey,
36                                         OPENSSL_CTX *libctx,
37                                         const char *propquery);
38
39 #endif
40