Clean up the namespace.
[fides] / lib / privatekey.h
1 /* PrivateKey.h - Fides private key class
2    Copyright (C) 2008-2009  Guus Sliepen <guus@tinc-vpn.org>
3   
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.
8   
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.
13   
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/>.
16 */
17
18 #ifndef __FIDES_PRIVATEKEY_H__
19 #define __FIDES_PRIVATEKEY_H__
20
21 #include <string>
22 #include <botan/botan.h>
23 #include <botan/ecdsa.h>
24 #include "publickey.h"
25
26 namespace Fides {
27         class PrivateKey: public PublicKey {
28                 Botan::ECDSA_PrivateKey *priv;
29
30                 public:
31                 PrivateKey();
32                 ~PrivateKey();
33
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;
41         };
42 }
43
44 #endif