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 SigningContext.h
\r
20 * Interface to signing process supplied by a signing application
\r
23 #if !defined(__xmltooling_signctx_h__) && !defined(XMLTOOLING_NO_XMLSEC)
\r
24 #define __xmltooling_signctx_h__
\r
26 #include <xmltooling/signature/KeyInfo.h>
\r
27 #include <xmltooling/util/CredentialResolver.h>
\r
30 #include <xsec/dsig/DSIGSignature.hpp>
\r
32 #if defined (_MSC_VER)
\r
33 #pragma warning( push )
\r
34 #pragma warning( disable : 4250 4251 )
\r
37 namespace xmlsignature {
\r
40 * Interface to signing process supplied by a signing application
\r
42 class XMLTOOL_API SigningContext
\r
44 MAKE_NONCOPYABLE(SigningContext);
\r
46 virtual ~SigningContext() {}
\r
49 * Given a "blank" native signature, asks the context to define the
\r
50 * appropriate signature transforms, references, etc. The context
\r
51 * should return true iff the necessary ds:KeyInfo information was
\r
54 * @param sig native signature interface
\r
55 * @return indicator whether ds:KeyInfo was created by context
\r
57 virtual bool createSignature(DSIGSignature* sig)=0;
\r
60 * Gets a reference to a credential resolver.
\r
61 * The resolver's certificates will be included in the signature only
\r
62 * if the context returns false when creating the signature and returns
\r
63 * NULL from the getKeyInfo() method.
\r
66 * @return a resolver to the credentials to sign with
\r
68 virtual xmltooling::CredentialResolver& getCredentialResolver()=0;
\r
71 * Gets a KeyInfo structure to embed.
\r
72 * Ownership of the object MUST be transferred to the caller.
\r
74 * @return pointer to a KeyInfo structure, will be freed by caller
\r
76 virtual KeyInfo* getKeyInfo()=0;
\r
84 #if defined (_MSC_VER)
\r
85 #pragma warning( pop )
\r
88 #endif /* __xmltooling_signctx_h__ */
\r