2 * Copyright (C) 2008-2009 Martin Willi
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
17 #include "x509_plugin.h"
20 #include "x509_cert.h"
23 #include "x509_ocsp_request.h"
24 #include "x509_ocsp_response.h"
25 #include "x509_pkcs10.h"
27 typedef struct private_x509_plugin_t private_x509_plugin_t
;
30 * private data of x509_plugin
32 struct private_x509_plugin_t
{
40 METHOD(plugin_t
, get_name
, char*,
41 private_x509_plugin_t
*this)
46 METHOD(plugin_t
, get_features
, int,
47 private_x509_plugin_t
*this, plugin_feature_t
*features
[])
49 static plugin_feature_t f
[] = {
50 PLUGIN_REGISTER(CERT_ENCODE
, x509_cert_gen
, FALSE
),
51 PLUGIN_PROVIDE(CERT_ENCODE
, CERT_X509
),
52 PLUGIN_DEPENDS(HASHER
, HASH_SHA1
),
53 PLUGIN_REGISTER(CERT_DECODE
, x509_cert_load
, TRUE
),
54 PLUGIN_PROVIDE(CERT_DECODE
, CERT_X509
),
55 PLUGIN_DEPENDS(HASHER
, HASH_SHA1
),
56 PLUGIN_DEPENDS(PUBKEY
, KEY_ANY
),
58 PLUGIN_REGISTER(CERT_ENCODE
, x509_ac_gen
, FALSE
),
59 PLUGIN_PROVIDE(CERT_ENCODE
, CERT_X509_AC
),
60 PLUGIN_REGISTER(CERT_DECODE
, x509_ac_load
, TRUE
),
61 PLUGIN_PROVIDE(CERT_DECODE
, CERT_X509_AC
),
63 PLUGIN_REGISTER(CERT_ENCODE
, x509_crl_gen
, FALSE
),
64 PLUGIN_PROVIDE(CERT_ENCODE
, CERT_X509_CRL
),
65 PLUGIN_REGISTER(CERT_DECODE
, x509_crl_load
, TRUE
),
66 PLUGIN_PROVIDE(CERT_DECODE
, CERT_X509_CRL
),
68 PLUGIN_REGISTER(CERT_ENCODE
, x509_ocsp_request_gen
, FALSE
),
69 PLUGIN_PROVIDE(CERT_ENCODE
, CERT_X509_OCSP_REQUEST
),
70 PLUGIN_DEPENDS(HASHER
, HASH_SHA1
),
71 PLUGIN_DEPENDS(RNG
, RNG_WEAK
),
72 PLUGIN_REGISTER(CERT_DECODE
, x509_ocsp_response_load
, TRUE
),
73 PLUGIN_PROVIDE(CERT_DECODE
, CERT_X509_OCSP_RESPONSE
),
75 PLUGIN_REGISTER(CERT_ENCODE
, x509_pkcs10_gen
, FALSE
),
76 PLUGIN_PROVIDE(CERT_ENCODE
, CERT_PKCS10_REQUEST
),
77 PLUGIN_REGISTER(CERT_DECODE
, x509_pkcs10_load
, TRUE
),
78 PLUGIN_PROVIDE(CERT_DECODE
, CERT_PKCS10_REQUEST
),
84 METHOD(plugin_t
, destroy
, void,
85 private_x509_plugin_t
*this)
93 plugin_t
*x509_plugin_create()
95 private_x509_plugin_t
*this;
100 .get_name
= _get_name
,
101 .get_features
= _get_features
,
107 return &this->public.plugin
;