Back to index

nordugrid-arc-nox  1.1.0~rc6
X509Token.h
Go to the documentation of this file.
00001 #ifndef __ARC_X509TOKEN_H__
00002 #define __ARC_X509TOKEN_H__
00003 
00004 #include <arc/XMLNode.h>
00005 #include <arc/message/SOAPEnvelope.h>
00006 
00007 // WS-Security X509 Token Profile v1.1
00008 // wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
00009 
00010 namespace Arc {
00011 
00013 
00019 class X509Token : public SOAPEnvelope {
00020 public:
00024   typedef enum {
00025     Signature,
00026     Encryption
00027   } X509TokenType;
00028 
00037   X509Token(SOAPEnvelope& soap, const std::string& keyfile = "");
00038 
00049   X509Token(SOAPEnvelope& soap, const std::string& certfile, const std::string& keyfile, X509TokenType token_type = Signature);
00050 
00053   ~X509Token(void);
00054 
00057   operator bool(void);
00058 
00071   bool Authenticate(const std::string& cafile, const std::string& capath);
00072 
00077   bool Authenticate(void);
00078 
00079 private:
00083   bool Check(SOAPEnvelope& soap);
00084 
00085 private:
00086   xmlNodePtr signature_nd;
00087   std::string cert_str;
00088   X509TokenType tokentype;  
00089 };
00090 
00091 } // namespace Arc
00092 
00093 #endif /* __ARC_X509TOKEN_H__ */
00094