1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultBroadcaster.hpp>
23 #include <com/sun/star/lang/XInitialization.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <cppuhelper/implbase.hxx>
27 #include <xmlsecuritydllapi.h>
28 #include <framework/signatureengine.hxx>
30 namespace com::sun::star::xml::crypto::sax
{ class XSignatureVerifyResultListener
; }
31 namespace com::sun::star::xml::crypto
{ class XXMLSecurityContext
; }
33 typedef cppu::ImplInheritanceHelper
36 css::xml::crypto::sax::XSignatureVerifyResultBroadcaster
,
37 css::lang::XInitialization
,
38 css::lang::XServiceInfo
39 > SignatureVerifierImpl_Base
;
41 class SignatureVerifierImpl final
: public SignatureVerifierImpl_Base
42 /****** SignatureVerifier.hxx/CLASS SignatureVerifierImpl *********************
45 * SignatureVerifierImpl -- verifies a signature
48 * Collects all resources for a signature verification, then verifies the
49 * signature by invoking a xmlsec-based signature bridge component.
50 ******************************************************************************/
53 css::uno::Reference
< css::xml::crypto::XXMLSecurityContext
> m_xXMLSecurityContext
;
55 virtual void notifyResultListener() const override
;
56 virtual void startEngine( const rtl::Reference
<XMLSignatureTemplateImpl
>& xSignatureTemplate
) override
;
59 explicit SignatureVerifierImpl();
60 virtual ~SignatureVerifierImpl() override
;
62 /* XSignatureVerifyResultBroadcaster */
63 virtual void SAL_CALL
addSignatureVerifyResultListener(
64 const css::uno::Reference
< css::xml::crypto::sax::XSignatureVerifyResultListener
>& listener
) override
;
65 virtual void SAL_CALL
removeSignatureVerifyResultListener(
66 const css::uno::Reference
< css::xml::crypto::sax::XSignatureVerifyResultListener
>& listener
) override
;
69 virtual void SAL_CALL
initialize(
70 const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
73 virtual OUString SAL_CALL
getImplementationName( ) override
;
74 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
75 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
77 void updateSignature( const css::uno::Reference
< css::xml::crypto::XXMLSignature
>& xSignature
,
78 const css::uno::Reference
< css::xml::crypto::XXMLSecurityContext
>& xContext
) { m_xXMLSignature
= xSignature
; m_xXMLSecurityContext
= xContext
; }
81 /// @throws css::uno::RuntimeException
82 OUString
SignatureVerifierImpl_getImplementationName();
84 /// @throws css::uno::RuntimeException
85 css::uno::Sequence
< OUString
> SignatureVerifierImpl_getSupportedServiceNames( );
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */