monotone

monotone Mtn Source Tree

Root/botan/x509self.h

1/*************************************************
2* X.509 Self-Signed Certificate Header File *
3* (C) 1999-2007 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_X509_SELF_H__
7#define BOTAN_X509_SELF_H__
8
9#include <botan/x509cert.h>
10#include <botan/pkcs8.h>
11#include <botan/pkcs10.h>
12
13namespace Botan {
14
15/*************************************************
16* Options for X.509 Certificates *
17*************************************************/
18class X509_Cert_Options
19 {
20 public:
21 std::string common_name;
22 std::string country;
23 std::string organization;
24 std::string org_unit;
25 std::string locality;
26 std::string state;
27 std::string serial_number;
28
29 std::string email, uri, dns, ip, xmpp;
30
31 std::string challenge;
32
33 X509_Time start, end;
34
35 bool is_CA;
36 u32bit path_limit;
37 Key_Constraints constraints;
38 std::vector<OID> ex_constraints;
39
40 void sanity_check() const;
41
42 void CA_key(u32bit = 8);
43 void not_before(const std::string&);
44 void not_after(const std::string&);
45
46 void add_constraints(Key_Constraints);
47 void add_ex_constraint(const OID&);
48 void add_ex_constraint(const std::string&);
49
50 X509_Cert_Options(const std::string& = "");
51 };
52
53namespace X509 {
54
55/*************************************************
56* Create a self-signed X.509 certificate *
57*************************************************/
58X509_Certificate create_self_signed_cert(const X509_Cert_Options&,
59 const Private_Key&);
60
61/*************************************************
62* Create a PKCS #10 certificate request *
63*************************************************/
64PKCS10_Request create_cert_req(const X509_Cert_Options&,
65 const Private_Key&);
66
67}
68
69}
70
71#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status