2 * Copyright (C) 2015 Andreas Steffen
4 * Copyright (C) secunet Security Networks AG
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * @defgroup certificate_printer certificate_printer
19 * @{ @ingroup certificates
22 #ifndef CERTIFICATE_PRINTER_H_
23 #define CERTIFICATE_PRINTER_H_
25 typedef struct certificate_printer_t certificate_printer_t
;
27 #include "credentials/certificates/certificate.h"
28 #include "credentials/certificates/x509.h"
33 * An object for printing certificate information.
35 struct certificate_printer_t
{
38 * Print a certificate.
40 * @param cert certificate to be printed
41 * @param has_privkey indicates that certificate has a matching private key
43 void (*print
)(certificate_printer_t
*this, certificate_t
*cert
,
47 * Print a caption if the certificate type changed.
49 * @param type certificate type
50 * @param flag X.509 certificate flag
52 void (*print_caption
)(certificate_printer_t
*this, certificate_type_t type
,
56 * Destroy the certificate_printer object.
58 void (*destroy
)(certificate_printer_t
*this);
62 * Create a certificate_printer object
64 * @param f file where print output is directed to (usually stdout)
65 * @param detailed print more detailed certificate information
66 * @param utc print time information in UTC
68 certificate_printer_t
* certificate_printer_create(FILE *f
, bool detailed
,
71 #endif /** CERTIFICATE_PRINTER_H_ @}*/