4 * @brief Interface of certificate_t.
9 * Copyright (C) 2006 Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 #ifndef CERTIFICATE_H_
24 #define CERTIFICATE_H_
27 #include <definitions.h>
28 #include <crypto/rsa/rsa_public_key.h>
31 typedef struct certificate_t certificate_t
;
34 * @brief X509 certificate.
37 * - certificate_create_from_chunk()
41 struct certificate_t
{
44 * @brief Get the RSA public key from the certificate.
46 * @param this calling object
49 rsa_public_key_t
*(*get_public_key
) (certificate_t
*this);
52 * @brief Destroys the private key.
54 * @param this private key to destroy
56 void (*destroy
) (certificate_t
*this);
60 * @brief Read a certificate from a blob.
62 * @return created certificate_t.
66 certificate_t
*certificate_create_from_chunk(chunk_t chunk
);
68 certificate_t
*certificate_create_from_file(char *filename
);
70 #endif /* CERTIFICATE_H_ */