00001 // $Id: XrdCryptosslX509Req.hh 22437 2008-03-04 14:35:16Z rdm $ 00002 #ifndef __CRYPTO_SSLX509REQ_H__ 00003 #define __CRYPTO_SSLX509REQ_H__ 00004 /******************************************************************************/ 00005 /* */ 00006 /* X r d C r y p t o s s l X 5 0 9 R e q . h h */ 00007 /* */ 00008 /* */ 00009 /* (c) 2005 G. Ganis , CERN */ 00010 /* */ 00011 /******************************************************************************/ 00012 00013 /* ************************************************************************** */ 00014 /* */ 00015 /* OpenSSL implementation of XrdCryptoX509 */ 00016 /* */ 00017 /* ************************************************************************** */ 00018 00019 #include <XrdCrypto/XrdCryptoX509Req.hh> 00020 00021 #include <openssl/x509v3.h> 00022 #include <openssl/bio.h> 00023 00024 // ---------------------------------------------------------------------------// 00025 // 00026 // OpenSSL X509 request implementation 00027 // 00028 // ---------------------------------------------------------------------------// 00029 class XrdCryptosslX509Req : public XrdCryptoX509Req 00030 { 00031 00032 public: 00033 XrdCryptosslX509Req(XrdSutBucket *bck); 00034 XrdCryptosslX509Req(X509_REQ *creq); 00035 virtual ~XrdCryptosslX509Req(); 00036 00037 // Access underlying data (in opaque form: used in chains) 00038 XrdCryptoX509Reqdata Opaque() { return (XrdCryptoX509Reqdata)creq; } 00039 00040 // Access certificate key 00041 XrdCryptoRSA *PKI() { return pki; } 00042 00043 // Export in form of bucket (for transfers) 00044 XrdSutBucket *Export(); 00045 00046 // Relevant Names 00047 const char *Subject(); // get subject name 00048 00049 // Relevant hashes 00050 const char *SubjectHash(); // get hash of subject name 00051 00052 // Retrieve a given extension if there (in opaque form) 00053 XrdCryptoX509Reqdata GetExtension(const char *oid); 00054 00055 // Verify signature 00056 bool Verify(); 00057 00058 private: 00059 X509_REQ *creq; // The certificate request object 00060 XrdOucString subject; // subject; 00061 XrdOucString subjecthash; // hash of subject; 00062 XrdSutBucket *bucket; // Bucket for export operations 00063 XrdCryptoRSA *pki; // PKI of the certificate 00064 }; 00065 00066 #endif