diff options
author | lloyd <[email protected]> | 2008-09-29 16:44:06 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-29 16:44:06 +0000 |
commit | b67b7501e740c69e53e2ffcfa72538653eedf3b6 (patch) | |
tree | 96e0c0feab632f7ecdcc995311130a69b5265336 /src/cert/x509/x509find.h | |
parent | faa26383122ad694aa9ed82f7feb2e3ed3a7625e (diff) |
Move x509 into cert/ subdir (in prep for InSiTo adding cert/cvc)
Diffstat (limited to 'src/cert/x509/x509find.h')
-rw-r--r-- | src/cert/x509/x509find.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/cert/x509/x509find.h b/src/cert/x509/x509find.h new file mode 100644 index 000000000..65781199f --- /dev/null +++ b/src/cert/x509/x509find.h @@ -0,0 +1,58 @@ +/************************************************* +* X.509 Certificate Store Searching Header File * +* (C) 1999-2007 Jack Lloyd * +*************************************************/ + +#ifndef BOTAN_X509_CERT_STORE_SEARCH_H__ +#define BOTAN_X509_CERT_STORE_SEARCH_H__ + +#include <botan/x509stor.h> + +namespace Botan { + +/************************************************* +* Search based on the contents of a DN entry * +*************************************************/ +class BOTAN_DLL DN_Check : public X509_Store::Search_Func + { + public: + typedef bool (*compare_fn)(const std::string&, const std::string&); + enum Search_Type { SUBSTRING_MATCHING, IGNORE_CASE }; + + bool match(const X509_Certificate& cert) const; + + DN_Check(const std::string&, const std::string&, compare_fn); + DN_Check(const std::string&, const std::string&, Search_Type); + private: + std::string dn_entry, looking_for; + compare_fn compare; + }; + +/************************************************* +* Search for a certificate by issuer/serial * +*************************************************/ +class BOTAN_DLL IandS_Match : public X509_Store::Search_Func + { + public: + bool match(const X509_Certificate& cert) const; + IandS_Match(const X509_DN&, const MemoryRegion<byte>&); + private: + X509_DN issuer; + MemoryVector<byte> serial; + }; + +/************************************************* +* Search for a certificate by subject keyid * +*************************************************/ +class BOTAN_DLL SKID_Match : public X509_Store::Search_Func + { + public: + bool match(const X509_Certificate& cert) const; + SKID_Match(const MemoryRegion<byte>& s) : skid(s) {} + private: + MemoryVector<byte> skid; + }; + +} + +#endif |