Add inequality operator.
[shibboleth/cpp-xmltooling.git] / xmltooling / util / CredentialResolver.h
1 /*\r
2  *  Copyright 2001-2006 Internet2\r
3  * \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
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\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
15  */\r
16 \r
17 /**\r
18  * @file CredentialResolver.h\r
19  * \r
20  * Provides access to keys and certificates.\r
21  */\r
22 \r
23 #if !defined(__xmltooling_credres_h__) && !defined(XMLTOOLING_NO_XMLSEC)\r
24 #define __xmltooling_credres_h__\r
25 \r
26 #include <xmltooling/Lockable.h>\r
27 \r
28 #include <vector>\r
29 #include <xsec/enc/XSECCryptoKey.hpp>\r
30 #include <xsec/enc/XSECCryptoX509.hpp>\r
31 \r
32 namespace xmltooling {\r
33 \r
34     /**\r
35      * An abstract interface to credential formats like files, keystores, hardware tokens, etc.\r
36      * All non-const methods require that the interface be locked.\r
37      */\r
38     class XMLTOOL_API CredentialResolver : public virtual Lockable\r
39     {\r
40     MAKE_NONCOPYABLE(CredentialResolver);\r
41     public:\r
42         virtual ~CredentialResolver() {}\r
43 \r
44         /**\r
45          * Returns an identifier for the credential.\r
46          * \r
47          * @return      the identifier\r
48          */\r
49         virtual const char* getId() const=0;\r
50 \r
51         /**\r
52          * Gets the public key associated with the credential.\r
53          * The caller <strong>MUST NOT</strong> modify the object.\r
54          * \r
55          * @return      the public key, or NULL\r
56          */\r
57         virtual XSECCryptoKey* getPublicKey()=0;\r
58 \r
59         /**\r
60          * Gets the private key associated with the credential.\r
61          * The caller <strong>MUST NOT</strong> modify the object.\r
62          * \r
63          * @return      the private key, or NULL\r
64          */\r
65         virtual XSECCryptoKey* getPrivateKey()=0;\r
66 \r
67         /**\r
68          * Gets the certificate chain associated with the credential.\r
69          * The caller <strong>MUST NOT</strong> modify the objects.\r
70          * The EE certificate <strong>MUST</strong> be first.\r
71          * \r
72          * @return      a chain of certificates, or NULL\r
73          */\r
74         virtual const std::vector<XSECCryptoX509*>* getX509Certificates()=0;\r
75     \r
76     protected:\r
77         CredentialResolver() {}\r
78     };\r
79 \r
80 };\r
81 \r
82 #endif /* __xmltooling_credres_h__ */\r