merged tag ooo/OOO330_m14
[LibreOffice.git] / xmlsecurity / source / framework / signatureverifierimpl.hxx
blob68b4fff245d23eee2eac5211aa5cb7ce8b091232
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 _SIGNATUREVERIFIERIMPL_HXX
29 #define _SIGNATUREVERIFIERIMPL_HXX
31 #include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp>
32 #include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultBroadcaster.hpp>
33 #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
34 #include <com/sun/star/lang/XInitialization.hpp>
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <cppuhelper/implbase3.hxx>
38 #include "signatureengine.hxx"
40 class SignatureVerifierImpl : public cppu::ImplInheritanceHelper3
42 SignatureEngine,
43 com::sun::star::xml::crypto::sax::XSignatureVerifyResultBroadcaster,
44 com::sun::star::lang::XInitialization,
45 com::sun::star::lang::XServiceInfo
47 /****** SignatureVerifier.hxx/CLASS SignatureVerifierImpl *********************
49 * NAME
50 * SignatureVerifierImpl -- verifies a signature
52 * FUNCTION
53 * Collects all resources for a signature verification, then verifies the
54 * signature by invoking a xmlsec-based signature bridge component.
56 * HISTORY
57 * 05.01.2004 - Interface supported: XSignatureVerifyResultBroadcaster,
58 * XInitialization, XServiceInfo
60 * AUTHOR
61 * Michael Mi
62 * Email: michael.mi@sun.com
63 ******************************************************************************/
65 private:
67 * the Id of the signature, which is used for the result listener to
68 * identify the signature.
70 sal_Int32 m_nSignatureId;
73 * the verify result
75 bool m_bVerifySucceed;
77 com::sun::star::uno::Reference<
78 com::sun::star::xml::crypto::XXMLSecurityContext > m_xXMLSecurityContext;
80 virtual void notifyResultListener() const
81 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
82 virtual bool checkReady() const;
83 virtual void startEngine( const com::sun::star::uno::Reference<
84 com::sun::star::xml::crypto::XXMLSignatureTemplate >&
85 xSignatureTemplate)
86 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
88 public:
89 explicit SignatureVerifierImpl( const com::sun::star::uno::Reference<
90 com::sun::star::lang::XMultiServiceFactory >& rxMSF);
91 virtual ~SignatureVerifierImpl();
93 /* XSignatureVerifyResultBroadcaster */
94 virtual void SAL_CALL addSignatureVerifyResultListener(
95 const com::sun::star::uno::Reference<
96 com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener >&
97 listener )
98 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
99 virtual void SAL_CALL removeSignatureVerifyResultListener(
100 const com::sun::star::uno::Reference<
101 com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener >&
102 listener )
103 throw (com::sun::star::uno::RuntimeException);
105 /* XInitialization */
106 virtual void SAL_CALL initialize(
107 const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
108 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
110 /* XServiceInfo */
111 virtual rtl::OUString SAL_CALL getImplementationName( )
112 throw (com::sun::star::uno::RuntimeException);
113 virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
114 throw (com::sun::star::uno::RuntimeException);
115 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
116 throw (com::sun::star::uno::RuntimeException);
119 rtl::OUString SignatureVerifierImpl_getImplementationName()
120 throw ( com::sun::star::uno::RuntimeException );
122 sal_Bool SAL_CALL SignatureVerifierImpl_supportsService( const rtl::OUString& ServiceName )
123 throw ( com::sun::star::uno::RuntimeException );
125 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl_getSupportedServiceNames( )
126 throw ( com::sun::star::uno::RuntimeException );
128 com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
129 SAL_CALL SignatureVerifierImpl_createInstance(
130 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr)
131 throw ( com::sun::star::uno::Exception );
133 #endif