1
2
3
4
5
6
7
8 #include <linux/time.h>
9 #include <crypto/public_key.h>
10 #include <keys/asymmetric-type.h>
11
12 struct x509_certificate {
13 struct x509_certificate *next;
14 struct x509_certificate *signer;
15 struct public_key *pub;
16 struct public_key_signature *sig;
17 char *issuer;
18 char *subject;
19 struct asymmetric_key_id *id;
20 struct asymmetric_key_id *skid;
21 time64_t valid_from;
22 time64_t valid_to;
23 const void *tbs;
24 unsigned tbs_size;
25 unsigned raw_sig_size;
26 const void *raw_sig;
27 const void *raw_serial;
28 unsigned raw_serial_size;
29 unsigned raw_issuer_size;
30 const void *raw_issuer;
31 const void *raw_subject;
32 unsigned raw_subject_size;
33 unsigned raw_skid_size;
34 const void *raw_skid;
35 unsigned index;
36 bool seen;
37 bool verified;
38 bool self_signed;
39 bool unsupported_key;
40 bool unsupported_sig;
41 bool blacklisted;
42 };
43
44
45
46
47 extern void x509_free_certificate(struct x509_certificate *cert);
48 extern struct x509_certificate *x509_cert_parse(const void *data, size_t datalen);
49 extern int x509_decode_time(time64_t *_t, size_t hdrlen,
50 unsigned char tag,
51 const unsigned char *value, size_t vlen);
52
53
54
55
56 extern int x509_get_sig_params(struct x509_certificate *cert);
57 extern int x509_check_for_self_signed(struct x509_certificate *cert);