]> git.ipfire.org Git - thirdparty/strongswan.git/blob - src/libstrongswan/credentials/certificates/certificate_printer.h
Update copyright headers after acquisition by secunet
[thirdparty/strongswan.git] / src / libstrongswan / credentials / certificates / certificate_printer.h
1 /*
2 * Copyright (C) 2015 Andreas Steffen
3 *
4 * Copyright (C) secunet Security Networks AG
5 *
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>.
10 *
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
14 * for more details.
15 */
16
17 /**
18 * @defgroup certificate_printer certificate_printer
19 * @{ @ingroup certificates
20 */
21
22 #ifndef CERTIFICATE_PRINTER_H_
23 #define CERTIFICATE_PRINTER_H_
24
25 typedef struct certificate_printer_t certificate_printer_t;
26
27 #include "credentials/certificates/certificate.h"
28 #include "credentials/certificates/x509.h"
29
30 #include <stdio.h>
31
32 /**
33 * An object for printing certificate information.
34 */
35 struct certificate_printer_t {
36
37 /**
38 * Print a certificate.
39 *
40 * @param cert certificate to be printed
41 * @param has_privkey indicates that certificate has a matching private key
42 */
43 void (*print)(certificate_printer_t *this, certificate_t *cert,
44 bool has_privkey);
45
46 /**
47 * Print a caption if the certificate type changed.
48 *
49 * @param type certificate type
50 * @param flag X.509 certificate flag
51 */
52 void (*print_caption)(certificate_printer_t *this, certificate_type_t type,
53 x509_flag_t flag);
54
55 /**
56 * Destroy the certificate_printer object.
57 */
58 void (*destroy)(certificate_printer_t *this);
59 };
60
61 /**
62 * Create a certificate_printer object
63 *
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
67 */
68 certificate_printer_t* certificate_printer_create(FILE *f, bool detailed,
69 bool utc);
70
71 #endif /** CERTIFICATE_PRINTER_H_ @}*/