]>
Commit | Line | Data |
---|---|---|
7dcee34c DHG |
1 | /* |
2 | * {- join("\n * ", @autowarntext) -} | |
3 | * | |
4 | * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved. | |
5 | * | |
6 | * Licensed under the Apache License 2.0 (the "License"). You may not use | |
7 | * this file except in compliance with the License. You can obtain a copy | |
8 | * in the file LICENSE in the source distribution or at | |
9 | * https://www.openssl.org/source/license.html | |
10 | */ | |
11 | ||
12 | {- | |
13 | use OpenSSL::stackhash qw(generate_stack_macros); | |
14 | -} | |
15 | ||
16 | #ifndef OPENSSL_X509_ACERT_H | |
17 | # define OPENSSL_X509_ACERT_H | |
18 | # pragma once | |
19 | ||
20 | # include <openssl/x509v3.h> | |
21 | # include <openssl/x509.h> | |
22 | # include <openssl/pem.h> | |
23 | ||
24 | typedef struct X509_acert_st X509_ACERT; | |
25 | typedef struct X509_acert_info_st X509_ACERT_INFO; | |
26 | typedef struct ossl_object_digest_info_st OSSL_OBJECT_DIGEST_INFO; | |
27 | typedef struct ossl_issuer_serial_st OSSL_ISSUER_SERIAL; | |
28 | typedef struct X509_acert_issuer_v2form_st X509_ACERT_ISSUER_V2FORM; | |
29 | ||
30 | DECLARE_ASN1_FUNCTIONS(X509_ACERT) | |
31 | DECLARE_ASN1_DUP_FUNCTION(X509_ACERT) | |
32 | DECLARE_ASN1_ITEM(X509_ACERT_INFO) | |
33 | DECLARE_ASN1_ALLOC_FUNCTIONS(X509_ACERT_INFO) | |
34 | DECLARE_ASN1_ALLOC_FUNCTIONS(OSSL_OBJECT_DIGEST_INFO) | |
35 | DECLARE_ASN1_ALLOC_FUNCTIONS(OSSL_ISSUER_SERIAL) | |
36 | DECLARE_ASN1_ALLOC_FUNCTIONS(X509_ACERT_ISSUER_V2FORM) | |
37 | ||
38 | # ifndef OPENSSL_NO_STDIO | |
39 | X509_ACERT *d2i_X509_ACERT_fp(FILE *fp, X509_ACERT **acert); | |
40 | int i2d_X509_ACERT_fp(FILE *fp, const X509_ACERT *acert); | |
41 | # endif | |
42 | ||
43 | DECLARE_PEM_rw(X509_ACERT, X509_ACERT) | |
44 | ||
45 | X509_ACERT *d2i_X509_ACERT_bio(BIO *bp, X509_ACERT **acert); | |
46 | int i2d_X509_ACERT_bio(BIO *bp, const X509_ACERT *acert); | |
47 | ||
b97fb22f DHG |
48 | int X509_ACERT_sign(X509_ACERT *x, EVP_PKEY *pkey, const EVP_MD *md); |
49 | int X509_ACERT_sign_ctx(X509_ACERT *x, EVP_MD_CTX *ctx); | |
50 | int X509_ACERT_verify(X509_ACERT *a, EVP_PKEY *r); | |
51 | ||
9e1a8b5e DHG |
52 | # define X509_ACERT_VERSION_2 1 |
53 | ||
54 | const GENERAL_NAMES *X509_ACERT_get0_holder_entityName(const X509_ACERT *x); | |
55 | const OSSL_ISSUER_SERIAL *X509_ACERT_get0_holder_baseCertId(const X509_ACERT *x); | |
56 | const OSSL_OBJECT_DIGEST_INFO * X509_ACERT_get0_holder_digest(const X509_ACERT *x); | |
57 | const X509_NAME *X509_ACERT_get0_issuerName(const X509_ACERT *x); | |
58 | long X509_ACERT_get_version(const X509_ACERT *x); | |
59 | void X509_ACERT_get0_signature(const X509_ACERT *x, | |
60 | const ASN1_BIT_STRING **psig, | |
61 | const X509_ALGOR **palg); | |
62 | int X509_ACERT_get_signature_nid(const X509_ACERT *x); | |
63 | const X509_ALGOR *X509_ACERT_get0_info_sigalg(const X509_ACERT *x); | |
64 | const ASN1_INTEGER *X509_ACERT_get0_serialNumber(const X509_ACERT *x); | |
65 | const ASN1_TIME *X509_ACERT_get0_notBefore(const X509_ACERT *x); | |
66 | const ASN1_TIME *X509_ACERT_get0_notAfter(const X509_ACERT *x); | |
67 | const ASN1_BIT_STRING *X509_ACERT_get0_issuerUID(const X509_ACERT *x); | |
68 | ||
6b167313 DHG |
69 | int X509_ACERT_print(BIO *bp, X509_ACERT *x); |
70 | int X509_ACERT_print_ex(BIO *bp, X509_ACERT *x, unsigned long nmflags, | |
71 | unsigned long cflag); | |
72 | ||
62960b87 DHG |
73 | int X509_ACERT_get_attr_count(const X509_ACERT *x); |
74 | int X509_ACERT_get_attr_by_NID(const X509_ACERT *x, int nid, int lastpos); | |
75 | int X509_ACERT_get_attr_by_OBJ(const X509_ACERT *x, const ASN1_OBJECT *obj, | |
76 | int lastpos); | |
77 | X509_ATTRIBUTE *X509_ACERT_get_attr(const X509_ACERT *x, int loc); | |
78 | X509_ATTRIBUTE *X509_ACERT_delete_attr(X509_ACERT *x, int loc); | |
79 | ||
1eeec94f DHG |
80 | void *X509_ACERT_get_ext_d2i(const X509_ACERT *x, int nid, int *crit, int *idx); |
81 | int X509_ACERT_add1_ext_i2d(X509_ACERT *x, int nid, void *value, int crit, | |
82 | unsigned long flags); | |
83 | const STACK_OF(X509_EXTENSION) *X509_ACERT_get0_extensions(const X509_ACERT *x); | |
84 | ||
9e1a8b5e DHG |
85 | # define OSSL_OBJECT_DIGEST_INFO_PUBLIC_KEY 0 |
86 | # define OSSL_OBJECT_DIGEST_INFO_PUBLIC_KEY_CERT 1 | |
87 | # define OSSL_OBJECT_DIGEST_INFO_OTHER 2 /* must not be used in RFC 5755 profile */ | |
88 | int X509_ACERT_set_version(X509_ACERT *x, long version); | |
89 | void X509_ACERT_set0_holder_entityName(X509_ACERT *x, GENERAL_NAMES *name); | |
90 | void X509_ACERT_set0_holder_baseCertId(X509_ACERT *x, OSSL_ISSUER_SERIAL *isss); | |
91 | void X509_ACERT_set0_holder_digest(X509_ACERT *x, | |
92 | OSSL_OBJECT_DIGEST_INFO *dinfo); | |
93 | ||
62960b87 DHG |
94 | int X509_ACERT_add1_attr(X509_ACERT *x, X509_ATTRIBUTE *attr); |
95 | int X509_ACERT_add1_attr_by_OBJ(X509_ACERT *x, const ASN1_OBJECT *obj, | |
96 | int type, const void *bytes, int len); | |
97 | int X509_ACERT_add1_attr_by_NID(X509_ACERT *x, int nid, int type, | |
98 | const void *bytes, int len); | |
99 | int X509_ACERT_add1_attr_by_txt(X509_ACERT *x, const char *attrname, int type, | |
100 | const unsigned char *bytes, int len); | |
101 | ||
9e1a8b5e DHG |
102 | int X509_ACERT_set1_issuerName(X509_ACERT *x, const X509_NAME *name); |
103 | int X509_ACERT_set1_serialNumber(X509_ACERT *x, const ASN1_INTEGER *serial); | |
104 | int X509_ACERT_set1_notBefore(X509_ACERT *x, const ASN1_GENERALIZEDTIME *time); | |
105 | int X509_ACERT_set1_notAfter(X509_ACERT *x, const ASN1_GENERALIZEDTIME *time); | |
106 | ||
107 | void OSSL_OBJECT_DIGEST_INFO_get0_digest(const OSSL_OBJECT_DIGEST_INFO *o, | |
108 | int *digestedObjectType, | |
109 | const X509_ALGOR **digestAlgorithm, | |
110 | const ASN1_BIT_STRING **digest); | |
111 | ||
112 | int OSSL_OBJECT_DIGEST_INFO_set1_digest(OSSL_OBJECT_DIGEST_INFO *o, | |
113 | int digestedObjectType, | |
114 | X509_ALGOR *digestAlgorithm, | |
115 | ASN1_BIT_STRING *digest); | |
116 | ||
117 | const X509_NAME *OSSL_ISSUER_SERIAL_get0_issuer(const OSSL_ISSUER_SERIAL *isss); | |
118 | const ASN1_INTEGER *OSSL_ISSUER_SERIAL_get0_serial(const OSSL_ISSUER_SERIAL *isss); | |
119 | const ASN1_BIT_STRING *OSSL_ISSUER_SERIAL_get0_issuerUID(const OSSL_ISSUER_SERIAL *isss); | |
120 | ||
121 | int OSSL_ISSUER_SERIAL_set1_issuer(OSSL_ISSUER_SERIAL *isss, | |
122 | const X509_NAME *issuer); | |
123 | int OSSL_ISSUER_SERIAL_set1_serial(OSSL_ISSUER_SERIAL *isss, | |
124 | const ASN1_INTEGER *serial); | |
125 | int OSSL_ISSUER_SERIAL_set1_issuerUID(OSSL_ISSUER_SERIAL *isss, | |
126 | const ASN1_BIT_STRING *uid); | |
7dcee34c | 127 | #endif |