00001 // $Id: XrdCryptoX509Req.hh 28154 2009-04-08 12:40:52Z ganis $ 00002 #ifndef __CRYPTO_X509REQ_H__ 00003 #define __CRYPTO_X509REQ_H__ 00004 /******************************************************************************/ 00005 /* */ 00006 /* X r d C r y p t o X 5 0 9 R e q. h h */ 00007 /* */ 00008 /* */ 00009 /* (c) 2005 G. Ganis , CERN */ 00010 /* */ 00011 /******************************************************************************/ 00012 00013 /* ************************************************************************** */ 00014 /* */ 00015 /* Abstract interface for X509 certificates. */ 00016 /* Allows to plug-in modules based on different crypto implementation */ 00017 /* (OpenSSL, Botan, ...) */ 00018 /* */ 00019 /* ************************************************************************** */ 00020 00021 #include <XrdSut/XrdSutBucket.hh> 00022 #include <XrdCrypto/XrdCryptoRSA.hh> 00023 00024 typedef void * XrdCryptoX509Reqdata; 00025 00026 // ---------------------------------------------------------------------------// 00027 // 00028 // X509 request interface 00029 // Describes a one certificate request 00030 // 00031 // ---------------------------------------------------------------------------// 00032 class XrdCryptoX509Req { 00033 public: 00034 00035 XrdCryptoX509Req(int v = -1) { SetVersion(v); } 00036 virtual ~XrdCryptoX509Req() { } 00037 00038 // Status 00039 virtual bool IsValid(); 00040 00041 // Access underlying data (in opaque form: used in chains) 00042 virtual XrdCryptoX509Reqdata Opaque(); 00043 00044 // Access certificate key 00045 virtual XrdCryptoRSA *PKI(); 00046 00047 // Export in form of bucket (for transfers) 00048 virtual XrdSutBucket *Export(); 00049 00050 // Dump information 00051 virtual void Dump(); 00052 00053 // Subject of bottom certificate 00054 virtual const char *Subject(); 00055 virtual const char *SubjectHash(); // hash 00056 00057 // Retrieve a given extension if there (in opaque form) 00058 virtual XrdCryptoX509Reqdata GetExtension(const char *oid); 00059 00060 // Verify signature 00061 virtual bool Verify(); 00062 00063 // Set / Get version 00064 int Version() const { return version; } 00065 void SetVersion(int v) { version = v; } 00066 00067 private: 00068 int version; // Version of the plugin producing the request 00069 }; 00070 00071 #endif