2 * Copyright 2001-2006 Internet2
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
18 * @file xmltooling/signature/CredentialResolver.h
\r
20 * Resolves keys and certificates "owned" by an entity
\r
23 #if !defined(__xmltooling_credres_h__) && !defined(XMLTOOLING_NO_XMLSEC)
\r
24 #define __xmltooling_credres_h__
\r
26 #include <xmltooling/Lockable.h>
\r
29 #include <xsec/enc/XSECCryptoKey.hpp>
\r
30 #include <xsec/enc/XSECCryptoX509.hpp>
\r
32 namespace xmlsignature {
\r
35 * An API for resolving local/owned keys and certificates
\r
37 class XMLTOOL_API CredentialResolver : public xmltooling::Lockable
\r
39 MAKE_NONCOPYABLE(CredentialResolver);
\r
41 CredentialResolver() {}
\r
44 virtual ~CredentialResolver() {}
\r
47 * Returns a secret or private key to use for signing operations.
\r
48 * The caller is responsible for deleting the key when finished with it.
\r
50 * @return a secret or private key
\r
52 virtual XSECCryptoKey* getKey() const=0;
\r
55 * Returns a set of certificates to publish during signing operations.
\r
56 * The certificates must be cloned if kept beyond the scope of a lock.
\r
58 * @return a set of certificates
\r
60 virtual const std::vector<XSECCryptoX509*>& getCertificates() const=0;
\r
64 * Registers CredentialResolver classes into the runtime.
\r
66 void XMLTOOL_API registerCredentialResolvers();
\r
68 /** CredentialResolver based on local files */
\r
69 #define FILESYSTEM_CREDENTIAL_RESOLVER "org.opensaml.xmlooling.FilesystemCredentialResolver"
\r
72 #endif /* __xmltooling_credres_h__ */
\r