1 /* PrivateKey.h - Fides private key class
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_PRIVATEKEY_H__
19 #define __FIDES_PRIVATEKEY_H__
22 #include <botan/botan.h>
23 #include <botan/ecdsa.h>
24 #include "publickey.h"
27 class PrivateKey: public PublicKey {
28 Botan::ECDSA_PrivateKey *priv;
34 void load_private(std::istream &in);
35 void save_private(std::ostream &out) const;
36 void load_private(const std::string &filename);
37 void save_private(const std::string &filename) const;
38 void generate(const std::string &field);
39 void generate(unsigned int bits = 224);
40 std::string sign(const std::string &data) const;