Fix solution file, add .gitignore
[shibboleth/cpp-sp-resolver.git] / src / shibresolver / resolver.h
index 7ae1634..d6b7a87 100644 (file)
@@ -1,9 +1,8 @@
-/*
- *  Copyright 2010-2011 JANET(UK)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * See the NOTICE file distributed with this work for information
+ * regarding copyright ownership. Licensed under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -27,8 +26,8 @@
 
 #include <shibsp/RequestMapper.h>
 #include <shibsp/SPConfig.h>
+#include <xmltooling/unicode.h>
 
-#include <string>
 #include <vector>
 
 #ifdef SHIBRESOLVER_HAVE_GSSGNU
@@ -36,7 +35,7 @@
 #elif defined SHIBRESOLVER_HAVE_GSSMIT
 # include <gssapi/gssapi.h>
 # include <gssapi/gssapi_generic.h>
-#else
+#elif defined SHIBRESOLVER_HAVE_GSSAPI
 # include <gssapi.h>
 #endif
 
@@ -91,6 +90,13 @@ namespace shibresolver {
         void setIssuer(const char* issuer);
 
         /**
+         * Sets the metadata protocol constant to use for resolution.
+         *
+         * @param protocol  metadata protocol constant
+         */
+        void setProtocol(const XMLCh* protocol);
+
+        /**
          * Adds an XML token as input to the resolver, generally a SAML assertion.
          * <p>The caller retains ownership of the object.
          *
@@ -100,21 +106,31 @@ namespace shibresolver {
 
 #ifdef SHIBRESOLVER_HAVE_GSSAPI
         /**
-         * Adds a GSS-API security context as input to the resolver.
-         * <p>The caller loses ownership of the context.
+         * Adds a GSS-API exported mechanism name as input to
+         * the resolver.
+         * <p>The caller retains ownership of the buffer.
          *
-         * @param ctx an input context to evaluate
+         * @param ctx an input exported mechanism name to evaluate
          */
-        void addToken(gss_ctx_id_t* ctx);
+        void addToken(const gss_buffer_t name);
 
+# ifdef SHIBRESOLVER_HAVE_GSSAPI_NAMINGEXTS
         /**
-         * Adds a GSS-API exported security context as input to
-         * the resolver.
-         * <p>The caller retains ownership of the buffer.
+         * Adds a GSS-API mechanism name as input to the resolver.
+         * <p>The caller retains ownership of the name.
+         *
+         * @param name an input mechanism name to evaluate
+         */
+        void addToken(gss_name_t name);
+# endif
+
+        /**
+         * Adds a GSS-API security context as input to the resolver.
+         * <p>The caller loses ownership of the context.
          *
-         * @param ctx an input exported security context to evaluate
+         * @param ctx an input context to evaluate
          */
-        void addToken(gss_buffer_t token);
+        void addToken(gss_ctx_id_t* ctx);
 #endif
 
         /**
@@ -191,6 +207,9 @@ namespace shibresolver {
         /** Source of identity, if known. */
         std::string m_issuer;
 
+        /** Metadata protocol constant to use. */
+        xmltooling::xstring m_protocol;
+
         /** Input tokens. */
         std::vector<const xmltooling::XMLObject*> m_tokens;