1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: signaturecreatorimpl.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SIGNATURECREATORIMPL_HXX
32 #define _SIGNATURECREATORIMPL_HXX
34 #include <com/sun/star/xml/crypto/sax/XBlockerMonitor.hpp>
35 #include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp>
36 #include <com/sun/star/xml/crypto/sax/XSignatureCreationResultBroadcaster.hpp>
37 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
38 #include <com/sun/star/lang/XInitialization.hpp>
39 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #include <cppuhelper/implbase4.hxx>
42 #include "signatureengine.hxx"
44 class SignatureCreatorImpl
: public cppu::ImplInheritanceHelper4
47 com::sun::star::xml::crypto::sax::XBlockerMonitor
,
48 com::sun::star::xml::crypto::sax::XSignatureCreationResultBroadcaster
,
49 com::sun::star::lang::XInitialization
,
50 com::sun::star::lang::XServiceInfo
52 /****** SignatureCreatorImpl.hxx/CLASS SignatureCreatorImpl *******************
55 * SignatureCreatorImpl -- generates a signature
58 * Collects all resources for a signature generation, then generates the
59 * signature by invoking a xmlsec-based signature bridge component.
62 * 05.01.2004 - Interface supported: XBlockerMonitor,
63 * XInitialization, XServiceInfo
67 * Email: michael.mi@sun.com
68 ******************************************************************************/
72 * the Id of the signature, which is used for the result listener to
73 * identify the signature.
75 sal_Int32 m_nSignatureId
;
78 * the Id of template blocker.
80 sal_Int32 m_nIdOfBlocker
;
83 * the signature creation result
85 bool m_bCreationSucceed
;
87 com::sun::star::uno::Reference
<
88 com::sun::star::xml::crypto::XSecurityEnvironment
> m_xSecurityEnvironment
;
90 virtual void notifyResultListener() const
91 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
92 virtual void clearUp( ) const;
93 virtual bool checkReady() const;
94 virtual void startEngine( const com::sun::star::uno::Reference
<
95 com::sun::star::xml::crypto::XXMLSignatureTemplate
>&
97 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
100 explicit SignatureCreatorImpl( const com::sun::star::uno::Reference
<
101 com::sun::star::lang::XMultiServiceFactory
>& rxMSF
);
102 virtual ~SignatureCreatorImpl();
104 /* XBlockerMonitor */
105 virtual void SAL_CALL
setBlockerId( sal_Int32 id
)
106 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
108 /* XSignatureCreationResultBroadcaster */
109 void SAL_CALL
addSignatureCreationResultListener(
110 const com::sun::star::uno::Reference
<
111 com::sun::star::xml::crypto::sax::XSignatureCreationResultListener
>& listener
)
112 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
114 void SAL_CALL
removeSignatureCreationResultListener(
115 const com::sun::star::uno::Reference
<
116 com::sun::star::xml::crypto::sax::XSignatureCreationResultListener
>& listener
)
117 throw (com::sun::star::uno::RuntimeException
);
119 /* XInitialization */
120 virtual void SAL_CALL
initialize(
121 const com::sun::star::uno::Sequence
< com::sun::star::uno::Any
>& aArguments
)
122 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
125 virtual rtl::OUString SAL_CALL
getImplementationName( )
126 throw (com::sun::star::uno::RuntimeException
);
127 virtual sal_Bool SAL_CALL
supportsService( const rtl::OUString
& ServiceName
)
128 throw (com::sun::star::uno::RuntimeException
);
129 virtual com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
getSupportedServiceNames( )
130 throw (com::sun::star::uno::RuntimeException
);
133 rtl::OUString
SignatureCreatorImpl_getImplementationName()
134 throw ( com::sun::star::uno::RuntimeException
);
136 sal_Bool SAL_CALL
SignatureCreatorImpl_supportsService( const rtl::OUString
& ServiceName
)
137 throw ( com::sun::star::uno::RuntimeException
);
139 com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
SignatureCreatorImpl_getSupportedServiceNames( )
140 throw ( com::sun::star::uno::RuntimeException
);
142 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
>
143 SAL_CALL
SignatureCreatorImpl_createInstance(
144 const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
> & rSMgr
)
145 throw ( com::sun::star::uno::Exception
);