1 /* certificate.h - Fides certificate 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_CERTIFICATE_H__
19 #define __FIDES_CERTIFICATE_H__
23 #include "publickey.h"
24 #include "privatekey.h"
30 /// Public key that signed this certificate.
31 const publickey *signer;
32 struct timeval timestamp;
33 std::string statement;
34 std::string signature;
37 certificate(const publickey *pub, struct timeval timestamp, const std::string &statement, const std::string &signature);
38 certificate(const privatekey *priv, struct timeval timestamp, const std::string &statement);
40 std::string to_string() const;
41 std::string fingerprint(unsigned int bits = 64) const;
42 bool validate() const;