Update ooo320-m1
[ooovba.git] / xmlsecurity / source / framework / signatureverifierimpl.hxx
blob039f24235c6e04186e9a2b8f37b8e8ea030af931
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: signatureverifierimpl.hxx,v $
10 * $Revision: 1.4 $
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 _SIGNATUREVERIFIERIMPL_HXX
32 #define _SIGNATUREVERIFIERIMPL_HXX
34 #include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp>
35 #include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultBroadcaster.hpp>
36 #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
37 #include <com/sun/star/lang/XInitialization.hpp>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <cppuhelper/implbase3.hxx>
41 #include "signatureengine.hxx"
43 class SignatureVerifierImpl : public cppu::ImplInheritanceHelper3
45 SignatureEngine,
46 com::sun::star::xml::crypto::sax::XSignatureVerifyResultBroadcaster,
47 com::sun::star::lang::XInitialization,
48 com::sun::star::lang::XServiceInfo
50 /****** SignatureVerifier.hxx/CLASS SignatureVerifierImpl *********************
52 * NAME
53 * SignatureVerifierImpl -- verifies a signature
55 * FUNCTION
56 * Collects all resources for a signature verification, then verifies the
57 * signature by invoking a xmlsec-based signature bridge component.
59 * HISTORY
60 * 05.01.2004 - Interface supported: XSignatureVerifyResultBroadcaster,
61 * XInitialization, XServiceInfo
63 * AUTHOR
64 * Michael Mi
65 * Email: michael.mi@sun.com
66 ******************************************************************************/
68 private:
70 * the Id of the signature, which is used for the result listener to
71 * identify the signature.
73 sal_Int32 m_nSignatureId;
76 * the verify result
78 bool m_bVerifySucceed;
80 com::sun::star::uno::Reference<
81 com::sun::star::xml::crypto::XXMLSecurityContext > m_xXMLSecurityContext;
83 virtual void notifyResultListener() const
84 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
85 virtual bool checkReady() const;
86 virtual void startEngine( const com::sun::star::uno::Reference<
87 com::sun::star::xml::crypto::XXMLSignatureTemplate >&
88 xSignatureTemplate)
89 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
91 public:
92 explicit SignatureVerifierImpl( const com::sun::star::uno::Reference<
93 com::sun::star::lang::XMultiServiceFactory >& rxMSF);
94 virtual ~SignatureVerifierImpl();
96 /* XSignatureVerifyResultBroadcaster */
97 virtual void SAL_CALL addSignatureVerifyResultListener(
98 const com::sun::star::uno::Reference<
99 com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener >&
100 listener )
101 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
102 virtual void SAL_CALL removeSignatureVerifyResultListener(
103 const com::sun::star::uno::Reference<
104 com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener >&
105 listener )
106 throw (com::sun::star::uno::RuntimeException);
108 /* XInitialization */
109 virtual void SAL_CALL initialize(
110 const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
111 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
113 /* XServiceInfo */
114 virtual rtl::OUString SAL_CALL getImplementationName( )
115 throw (com::sun::star::uno::RuntimeException);
116 virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
117 throw (com::sun::star::uno::RuntimeException);
118 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
119 throw (com::sun::star::uno::RuntimeException);
122 rtl::OUString SignatureVerifierImpl_getImplementationName()
123 throw ( com::sun::star::uno::RuntimeException );
125 sal_Bool SAL_CALL SignatureVerifierImpl_supportsService( const rtl::OUString& ServiceName )
126 throw ( com::sun::star::uno::RuntimeException );
128 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl_getSupportedServiceNames( )
129 throw ( com::sun::star::uno::RuntimeException );
131 com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
132 SAL_CALL SignatureVerifierImpl_createInstance(
133 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr)
134 throw ( com::sun::star::uno::Exception );
136 #endif