Adapt OPENSSL_POLICY_DEBUG to the new generic trace API
[openssl.git] / include / openssl / ess.h
1 /*
2  * Copyright 2019 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 HEADER_ESS_H
11 # define HEADER_ESS_H
12
13 # include <openssl/opensslconf.h>
14
15 # ifdef  __cplusplus
16 extern "C" {
17 # endif
18 # include <openssl/safestack.h>
19 # include <openssl/x509.h>
20 # include <openssl/esserr.h>
21
22 typedef struct ESS_issuer_serial ESS_ISSUER_SERIAL;
23 typedef struct ESS_cert_id ESS_CERT_ID;
24 typedef struct ESS_signing_cert ESS_SIGNING_CERT;
25
26 DEFINE_STACK_OF(ESS_CERT_ID)
27
28 typedef struct ESS_signing_cert_v2_st ESS_SIGNING_CERT_V2;
29 typedef struct ESS_cert_id_v2_st ESS_CERT_ID_V2;
30
31 DEFINE_STACK_OF(ESS_CERT_ID_V2)
32
33 ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_new(void);
34 void ESS_ISSUER_SERIAL_free(ESS_ISSUER_SERIAL *a);
35 int i2d_ESS_ISSUER_SERIAL(const ESS_ISSUER_SERIAL *a, unsigned char **pp);
36 ESS_ISSUER_SERIAL *d2i_ESS_ISSUER_SERIAL(ESS_ISSUER_SERIAL **a,
37                                          const unsigned char **pp,
38                                          long length);
39 ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_dup(ESS_ISSUER_SERIAL *a);
40
41 ESS_CERT_ID *ESS_CERT_ID_new(void);
42 void ESS_CERT_ID_free(ESS_CERT_ID *a);
43 int i2d_ESS_CERT_ID(const ESS_CERT_ID *a, unsigned char **pp);
44 ESS_CERT_ID *d2i_ESS_CERT_ID(ESS_CERT_ID **a, const unsigned char **pp,
45                              long length);
46 ESS_CERT_ID *ESS_CERT_ID_dup(ESS_CERT_ID *a);
47
48 ESS_SIGNING_CERT *ESS_SIGNING_CERT_new(void);
49 void ESS_SIGNING_CERT_free(ESS_SIGNING_CERT *a);
50 int i2d_ESS_SIGNING_CERT(const ESS_SIGNING_CERT *a, unsigned char **pp);
51 ESS_SIGNING_CERT *d2i_ESS_SIGNING_CERT(ESS_SIGNING_CERT **a,
52                                        const unsigned char **pp, long length);
53 ESS_SIGNING_CERT *ESS_SIGNING_CERT_dup(ESS_SIGNING_CERT *a);
54 ESS_SIGNING_CERT *ESS_SIGNING_CERT_new_init(X509 *signcert,
55                                             STACK_OF(X509) *certs,
56                                             int issuer_needed);
57
58 ESS_CERT_ID_V2 *ESS_CERT_ID_V2_new(void);
59 void ESS_CERT_ID_V2_free(ESS_CERT_ID_V2 *a);
60 int i2d_ESS_CERT_ID_V2(const ESS_CERT_ID_V2 *a, unsigned char **pp);
61 ESS_CERT_ID_V2 *d2i_ESS_CERT_ID_V2(ESS_CERT_ID_V2 **a,
62                                    const unsigned char **pp, long length);
63 ESS_CERT_ID_V2 *ESS_CERT_ID_V2_dup(ESS_CERT_ID_V2 *a);
64
65 ESS_SIGNING_CERT_V2 *ESS_SIGNING_CERT_V2_new(void);
66 void ESS_SIGNING_CERT_V2_free(ESS_SIGNING_CERT_V2 *a);
67 int i2d_ESS_SIGNING_CERT_V2(const ESS_SIGNING_CERT_V2 *a, unsigned char **pp);
68 ESS_SIGNING_CERT_V2 *d2i_ESS_SIGNING_CERT_V2(ESS_SIGNING_CERT_V2 **a,
69                                              const unsigned char **pp,
70                                              long length);
71 ESS_SIGNING_CERT_V2 *ESS_SIGNING_CERT_V2_dup(ESS_SIGNING_CERT_V2 *a);
72 ESS_SIGNING_CERT_V2 *ESS_SIGNING_CERT_V2_new_init(const EVP_MD *hash_alg,
73                                                   X509 *signcert,
74                                                   STACK_OF(X509) *certs,
75                                                   int issuer_needed);
76
77 # ifdef  __cplusplus
78 }
79 # endif
80 #endif