monotone

monotone Mtn Source Tree

Root/botan/x509find.h

1/*************************************************
2* X.509 Certificate Store Searching Header File *
3* (C) 1999-2007 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_X509_CERT_STORE_SEARCH_H__
7#define BOTAN_X509_CERT_STORE_SEARCH_H__
8
9#include <botan/x509stor.h>
10
11namespace Botan {
12
13/*************************************************
14* Search based on the contents of a DN entry *
15*************************************************/
16class DN_Check : public X509_Store::Search_Func
17 {
18 public:
19 typedef bool (*compare_fn)(const std::string&, const std::string&);
20 enum Search_Type { SUBSTRING_MATCHING, IGNORE_CASE };
21
22 bool match(const X509_Certificate& cert) const;
23
24 DN_Check(const std::string&, const std::string&, compare_fn);
25 DN_Check(const std::string&, const std::string&, Search_Type);
26 private:
27 std::string dn_entry, looking_for;
28 compare_fn compare;
29 };
30
31/*************************************************
32* Search for a certificate by issuer/serial *
33*************************************************/
34class IandS_Match : public X509_Store::Search_Func
35 {
36 public:
37 bool match(const X509_Certificate& cert) const;
38 IandS_Match(const X509_DN&, const MemoryRegion<byte>&);
39 private:
40 X509_DN issuer;
41 MemoryVector<byte> serial;
42 };
43
44/*************************************************
45* Search for a certificate by subject keyid *
46*************************************************/
47class SKID_Match : public X509_Store::Search_Func
48 {
49 public:
50 bool match(const X509_Certificate& cert) const;
51 SKID_Match(const MemoryRegion<byte>& s) : skid(s) {}
52 private:
53 MemoryVector<byte> skid;
54 };
55
56}
57
58#endif

Archive Download this file

Branches

Tags

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