1 /* X.509 certificate parser internal definitions
3 * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
12 #include <linux/time.h>
13 #include <crypto/public_key.h>
15 struct x509_certificate {
16 struct x509_certificate *next;
17 struct public_key *pub; /* Public key details */
18 char *issuer; /* Name of certificate issuer */
19 char *subject; /* Name of certificate subject */
20 char *fingerprint; /* Key fingerprint as hex */
21 char *authority; /* Authority key fingerprint as hex */
24 enum pkey_algo pkey_algo : 8; /* Public key algorithm */
25 enum hash_algo sig_hash_algo : 8; /* Signature hash algorithm */
26 const void *tbs; /* Signed data */
27 unsigned tbs_size; /* Size of signed data */
28 unsigned raw_sig_size; /* Size of sigature */
29 const void *raw_sig; /* Signature data */
30 struct public_key_signature sig; /* Signature parameters */
36 extern void x509_free_certificate(struct x509_certificate *cert);
37 extern struct x509_certificate *x509_cert_parse(const void *data, size_t datalen);
42 extern int x509_get_sig_params(struct x509_certificate *cert);
43 extern int x509_check_signature(const struct public_key *pub,
44 struct x509_certificate *cert);