merged tag ooo/OOO330_m14
[LibreOffice.git] / xmlsecurity / source / framework / signaturecreatorimpl.hxx
blobdb25bf10f89319ef652ac19b5705deecd924ce89
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _SIGNATURECREATORIMPL_HXX
29 #define _SIGNATURECREATORIMPL_HXX
31 #include <com/sun/star/xml/crypto/sax/XBlockerMonitor.hpp>
32 #include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp>
33 #include <com/sun/star/xml/crypto/sax/XSignatureCreationResultBroadcaster.hpp>
34 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
35 #include <com/sun/star/lang/XInitialization.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <cppuhelper/implbase4.hxx>
39 #include "signatureengine.hxx"
41 class SignatureCreatorImpl : public cppu::ImplInheritanceHelper4
43 SignatureEngine,
44 com::sun::star::xml::crypto::sax::XBlockerMonitor,
45 com::sun::star::xml::crypto::sax::XSignatureCreationResultBroadcaster,
46 com::sun::star::lang::XInitialization,
47 com::sun::star::lang::XServiceInfo
49 /****** SignatureCreatorImpl.hxx/CLASS SignatureCreatorImpl *******************
51 * NAME
52 * SignatureCreatorImpl -- generates a signature
54 * FUNCTION
55 * Collects all resources for a signature generation, then generates the
56 * signature by invoking a xmlsec-based signature bridge component.
58 * HISTORY
59 * 05.01.2004 - Interface supported: XBlockerMonitor,
60 * XInitialization, XServiceInfo
62 * AUTHOR
63 * Michael Mi
64 * Email: michael.mi@sun.com
65 ******************************************************************************/
67 private:
69 * the Id of the signature, which is used for the result listener to
70 * identify the signature.
72 sal_Int32 m_nSignatureId;
75 * the Id of template blocker.
77 sal_Int32 m_nIdOfBlocker;
80 * the signature creation result
82 bool m_bCreationSucceed;
84 com::sun::star::uno::Reference<
85 com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment;
87 virtual void notifyResultListener() const
88 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
89 virtual void clearUp( ) const;
90 virtual bool checkReady() const;
91 virtual void startEngine( const com::sun::star::uno::Reference<
92 com::sun::star::xml::crypto::XXMLSignatureTemplate >&
93 xSignatureTemplate)
94 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
96 public:
97 explicit SignatureCreatorImpl( const com::sun::star::uno::Reference<
98 com::sun::star::lang::XMultiServiceFactory >& rxMSF);
99 virtual ~SignatureCreatorImpl();
101 /* XBlockerMonitor */
102 virtual void SAL_CALL setBlockerId( sal_Int32 id )
103 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
105 /* XSignatureCreationResultBroadcaster */
106 void SAL_CALL addSignatureCreationResultListener(
107 const com::sun::star::uno::Reference<
108 com::sun::star::xml::crypto::sax::XSignatureCreationResultListener >& listener )
109 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
111 void SAL_CALL removeSignatureCreationResultListener(
112 const com::sun::star::uno::Reference<
113 com::sun::star::xml::crypto::sax::XSignatureCreationResultListener >& listener )
114 throw (com::sun::star::uno::RuntimeException);
116 /* XInitialization */
117 virtual void SAL_CALL initialize(
118 const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
119 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
121 /* XServiceInfo */
122 virtual rtl::OUString SAL_CALL getImplementationName( )
123 throw (com::sun::star::uno::RuntimeException);
124 virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
125 throw (com::sun::star::uno::RuntimeException);
126 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
127 throw (com::sun::star::uno::RuntimeException);
130 rtl::OUString SignatureCreatorImpl_getImplementationName()
131 throw ( com::sun::star::uno::RuntimeException );
133 sal_Bool SAL_CALL SignatureCreatorImpl_supportsService( const rtl::OUString& ServiceName )
134 throw ( com::sun::star::uno::RuntimeException );
136 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SignatureCreatorImpl_getSupportedServiceNames( )
137 throw ( com::sun::star::uno::RuntimeException );
139 com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
140 SAL_CALL SignatureCreatorImpl_createInstance(
141 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr)
142 throw ( com::sun::star::uno::Exception );
144 #endif