2 * Copyright (C) 2014 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 "acert_plugin.h"
18 #include "acert_validator.h"
22 typedef struct private_acert_plugin_t private_acert_plugin_t
;
25 * private data of acert_plugin
27 struct private_acert_plugin_t
{
32 acert_plugin_t
public;
35 * Validator implementation instance.
37 acert_validator_t
*validator
;
40 METHOD(plugin_t
, get_name
, char*,
41 private_acert_plugin_t
*this)
49 static bool plugin_cb(private_acert_plugin_t
*this,
50 plugin_feature_t
*feature
, bool reg
, void *cb_data
)
54 lib
->credmgr
->add_validator(lib
->credmgr
, &this->validator
->validator
);
58 lib
->credmgr
->remove_validator(lib
->credmgr
, &this->validator
->validator
);
63 METHOD(plugin_t
, get_features
, int,
64 private_acert_plugin_t
*this, plugin_feature_t
*features
[])
66 static plugin_feature_t f
[] = {
67 PLUGIN_CALLBACK((plugin_feature_callback_t
)plugin_cb
, NULL
),
68 PLUGIN_PROVIDE(CUSTOM
, "acert"),
74 METHOD(plugin_t
, destroy
, void,
75 private_acert_plugin_t
*this)
77 this->validator
->destroy(this->validator
);
84 plugin_t
*acert_plugin_create()
86 private_acert_plugin_t
*this;
91 .get_name
= _get_name
,
92 .get_features
= _get_features
,
96 .validator
= acert_validator_create(),
99 return &this->public.plugin
;