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
* communicating with other entities.
*
* @param compact true iff the communication medium is such that only compact forms should be included
- * @return reference to a KeyInfo object
+ * @return a KeyInfo object, which must be freed by the caller
*/
- virtual const xmlsignature::KeyInfo* getKeyInfo(bool compact=false) const=0;
+ virtual xmlsignature::KeyInfo* getKeyInfo(bool compact=false) const=0;
/**
* Get the credential context information, which provides additional information
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;
};
};