X-Git-Url: http://tinc-vpn.org/git/browse?p=fides;a=blobdiff_plain;f=lib%2Fprivatekey.h;fp=lib%2Fprivatekey.h;h=9e958590ee2e74ffae94b81e98ae87a36d1167d4;hp=0000000000000000000000000000000000000000;hb=401e0b5e1d97ded0e2c7415c6dd0f94ee6bfb470;hpb=0f3083b8693bfaddc4bf3fd6ce7174ac06afa958 diff --git a/lib/privatekey.h b/lib/privatekey.h new file mode 100644 index 0000000..9e95859 --- /dev/null +++ b/lib/privatekey.h @@ -0,0 +1,44 @@ +/* privatekey.h - Fides private key class + 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_PRIVATEKEY_H__ +#define __FIDES_PRIVATEKEY_H__ + +#include +#include +#include +#include "publickey.h" + +namespace fides { + class privatekey: public publickey { + Botan::ECDSA_PrivateKey *priv; + + public: + privatekey(); + ~privatekey(); + + void load_private(std::istream &in); + void save_private(std::ostream &out) const; + void load_private(const std::string &filename); + void save_private(const std::string &filename) const; + void generate(const std::string &field); + void generate(unsigned int bits = 224); + std::string sign(const std::string &data) const; + }; +} + +#endif