1 /* fides.h - Light-weight, decentralised trust and authorisation management
2 Copyright (C) 2008-2009 Guus Sliepen <guus@tinc-vpn.org>
4 Fides is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of
7 the License, or (at your option) any later version.
9 Fides is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #ifndef __FIDES_PUBLICKEY_H__
19 #define __FIDES_PUBLICKEY_H__
23 #include <botan/botan.h>
24 #include <botan/ecdsa.h>
29 Botan::ECDSA_PublicKey *pub;
36 void load(std::istream &in);
37 void save(std::ostream &out) const;
38 void load(const std::string &filename);
39 void save(const std::string &filename) const;
40 bool verify(const std::string &data, const std::string &signature) const;
41 std::string to_string() const;
42 void from_string(const std::string &in);
43 std::string fingerprint(unsigned int bits = 64) const;