/*
* Copyright 2001-2007 Internet2
- *
+ *
* 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
/**
* @file xmltooling/security/Credential.h
- *
- * Wraps keys and related functionality.
+ *
+ * Wraps keys and related functionality.
*/
#if !defined(__xmltooling_cred_h__) && !defined(XMLTOOLING_NO_XMLSEC)
MAKE_NONCOPYABLE(Credential);
protected:
Credential() {}
-
+
public:
virtual ~Credential() {}
-
+
/**
- * Bitmask constants for limiting resolution process inside a CredentialResolver.
+ * Bitmask constants for limiting resolution process inside a CredentialResolver.
*/
enum ResolveTypes {
RESOLVE_KEYS = 1,
};
/**
- * Bitmask of use cases for credentials.
+ * Bitmask of use cases for credentials.
*/
enum UsageTypes {
UNSPECIFIED_CREDENTIAL = 0,
TLS_CREDENTIAL = 2,
ENCRYPTION_CREDENTIAL = 4
};
-
+
+ /**
+ * Bitmask of supported KeyInfo content to generate.
+ */
+ enum KeyInfoTypes {
+ KEYINFO_KEY_VALUE = 1,
+ KEYINFO_KEY_NAME = 2
+ };
+
/**
* Get credential usage types.
- *
+ *
* @return the usage bitmask
*/
virtual unsigned int getUsage() const=0;
/**
* Returns a secret or private key to use for signing or decryption operations.
- *
+ *
* @return a secret or private key
*/
virtual XSECCryptoKey* getPrivateKey() const=0;
/**
* Returns a secret or public key to use for verification or encryption operations.
- *
+ *
* @return a secret or public key
*/
virtual XSECCryptoKey* getPublicKey() const=0;
-
+
/**
* Returns names representing the Credential.
*
* <p>Names should be unique in the context of the comparisons against CredentialCriteria
* that deployments expect to see.
- *
+ *
* @return a sorted set of names
*/
virtual const std::set<std::string>& getKeyNames() const=0;
-
+
/**
* Returns a ds:KeyInfo object representing the Credential for use in
* communicating with other entities.
- *
+ *
* @param compact true iff the communication medium is such that only compact forms should be included
* @return a KeyInfo object, which must be freed by the caller
*/
/**
* Get the credential context information, which provides additional information
* specific to the context in which the credential was resolved.
- *
+ *
* @return resolution context of the credential
*/
virtual const CredentialContext* getCredentalContext() const {