00001 #ifndef __ARC_SAMLTOKEN_H__
00002 #define __ARC_SAMLTOKEN_H__
00003
00004 #include <arc/XMLNode.h>
00005 #include <arc/message/SOAPEnvelope.h>
00006
00007
00008
00009
00010 namespace Arc {
00011
00013
00065 class SAMLToken : public SOAPEnvelope {
00066 public:
00071 typedef enum {
00072 SAML1,
00073 SAML2
00074 } SAMLVersion;
00075
00082 SAMLToken(SOAPEnvelope& soap);
00083
00101 SAMLToken(SOAPEnvelope& soap, const std::string& certfile, const std::string& keyfile,
00102 SAMLVersion saml_version = SAML2, XMLNode saml_assertion = XMLNode());
00103
00106 ~SAMLToken(void);
00107
00109 operator bool(void);
00110
00120 bool Authenticate(const std::string& cafile, const std::string& capath);
00121
00124 bool Authenticate(void);
00125
00126 private:
00128 bool Check(SOAPEnvelope& soap);
00129
00130 private:
00131 xmlNodePtr assertion_signature_nd;
00132 xmlNodePtr wsse_signature_nd;
00136 std::string pubkey_str;
00137 std::string x509cert_str;
00140 XMLNode x509data;
00141
00142 SAMLVersion samlversion;
00143 };
00144
00145 }
00146
00147 #endif
00148