X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpublickey.h;fp=lib%2Fpublickey.h;h=ad7993c6ab730b0512372c6c9fd8b6b9cdcbeda6;hb=401e0b5e1d97ded0e2c7415c6dd0f94ee6bfb470;hp=0000000000000000000000000000000000000000;hpb=0f3083b8693bfaddc4bf3fd6ce7174ac06afa958;p=fides diff --git a/lib/publickey.h b/lib/publickey.h new file mode 100644 index 0000000..ad7993c --- /dev/null +++ b/lib/publickey.h @@ -0,0 +1,47 @@ +/* fides.h - Light-weight, decentralised trust and authorisation management + Copyright (C) 2008-2009 Guus Sliepen + + Fides is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of + the License, or (at your option) any later version. + + Fides is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, see . +*/ + +#ifndef __FIDES_PUBLICKEY_H__ +#define __FIDES_PUBLICKEY_H__ + +#include +#include +#include +#include + +namespace fides { + class publickey { + protected: + Botan::ECDSA_PublicKey *pub; + + public: + publickey(); + ~publickey(); + + int trust; + void load(std::istream &in); + void save(std::ostream &out) const; + void load(const std::string &filename); + void save(const std::string &filename) const; + bool verify(const std::string &data, const std::string &signature) const; + std::string to_string() const; + void from_string(const std::string &in); + std::string fingerprint(unsigned int bits = 64) const; + }; +} + +#endif