blob: 2d01182147703a551811cecad91f34ae5589d66f [file] [log] [blame]
David Howellsc26fd692012-09-24 17:11:48 +01001/* X.509 certificate parser internal definitions
2 *
3 * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
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.
10 */
11
David Howells57be4a72013-08-30 16:16:34 +010012#include <linux/time.h>
David Howellsc26fd692012-09-24 17:11:48 +010013#include <crypto/public_key.h>
14
15struct 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 */
David Howellsa5752d12012-10-02 14:36:16 +010022 struct tm valid_from;
23 struct tm valid_to;
David Howellsc26fd692012-09-24 17:11:48 +010024 enum pkey_algo sig_pkey_algo : 8; /* Signature public key algorithm */
25 enum pkey_hash_algo sig_hash_algo : 8; /* Signature hash algorithm */
26 const void *tbs; /* Signed data */
27 size_t tbs_size; /* Size of signed data */
28 const void *sig; /* Signature data */
29 size_t sig_size; /* Size of sigature */
30};
31
32/*
33 * x509_cert_parser.c
34 */
35extern void x509_free_certificate(struct x509_certificate *cert);
36extern struct x509_certificate *x509_cert_parse(const void *data, size_t datalen);