Multi-line svn commit, see body.
[shibboleth/cpp-xmltooling.git] / xmltooling / security / Credential.h
index 85c6505..02d4999 100644 (file)
@@ -53,12 +53,32 @@ namespace xmltooling {
     public:
         virtual ~Credential() {}
         
+        /**
+         * Bitmask constants for limiting resolution process inside a CredentialResolver. 
+         */
         enum ResolveTypes {
             RESOLVE_KEYS = 1,
             RESOLVE_NAMES = 2
         };
 
         /**
+         * Bitmask of use cases for credentials. 
+         */
+        enum UsageTypes {
+            UNSPECIFIED_CREDENTIAL = 0,
+            SIGNING_CREDENTIAL = 1,
+            TLS_CREDENTIAL = 2,
+            ENCRYPTION_CREDENTIAL = 4
+        };
+        
+        /**
+         * Get credential usage types.
+         * 
+         * @return the usage bitmask
+         */
+        virtual unsigned int getUsage() const=0;
+
+        /**
          * Returns an algorithm identifier for the Credential.
          *
          * @return  the Credential algorithm, or NULL if indeterminate
@@ -114,14 +134,6 @@ namespace xmltooling {
         virtual const CredentialContext* getCredentalContext() const {
             return NULL;
         }
-
-        /**
-         * Determines whether the supplied CredentialCriteria matches this Credential.
-         *
-         * @param criteria  the CredentialCriteria to evaluate
-         * @return true iff this Credential is consistent with the criteria
-         */
-        virtual bool matches(const CredentialCriteria& criteria) const;
     };
 };