diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-02 14:11:49 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-03 09:26:12 +0100 |
commit | 6cf3ef823a6419212e69f0ad308e0ef8efe31481 (patch) | |
tree | 8b5c3f765a564f075710ec733d0a08c1b5d34631 /xmlsecurity/inc | |
parent | c3965b1ce4428a97a8050a7bc53d60b642062502 (diff) |
xmlsecurity: can hold UriBindingHelper by rtl::Reference
... in XMLSignatureHelper and XSecController
Change-Id: Ie3817684c9ed9ed8a222e3ba56c8fbc389a68071
Reviewed-on: https://gerrit.libreoffice.org/44193
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'xmlsecurity/inc')
-rw-r--r-- | xmlsecurity/inc/xmlsignaturehelper.hxx | 4 | ||||
-rw-r--r-- | xmlsecurity/inc/xmlsignaturehelper2.hxx | 59 | ||||
-rw-r--r-- | xmlsecurity/inc/xsecctl.hxx | 10 |
3 files changed, 65 insertions, 8 deletions
diff --git a/xmlsecurity/inc/xmlsignaturehelper.hxx b/xmlsecurity/inc/xmlsignaturehelper.hxx index 97d73bfb3619..6f9784f4a690 100644 --- a/xmlsecurity/inc/xmlsignaturehelper.hxx +++ b/xmlsecurity/inc/xmlsignaturehelper.hxx @@ -28,10 +28,10 @@ #include <svl/sigstruct.hxx> #include "xsecctl.hxx" #include "xmlsecuritydllapi.h" +#include "xmlsignaturehelper.hxx" #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/xml/sax/XWriter.hpp> -#include <com/sun/star/xml/crypto/XUriBinding.hpp> #include <com/sun/star/xml/crypto/XSEInitializer.hpp> #include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp> #include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp> @@ -66,7 +66,7 @@ class XMLSECURITY_DLLPUBLIC XMLSignatureHelper { private: css::uno::Reference< css::uno::XComponentContext > mxCtx; - css::uno::Reference< css::xml::crypto::XUriBinding > mxUriBinding; + rtl::Reference<UriBindingHelper> mxUriBinding; rtl::Reference<XSecController> mpXSecController; bool mbError; diff --git a/xmlsecurity/inc/xmlsignaturehelper2.hxx b/xmlsecurity/inc/xmlsignaturehelper2.hxx new file mode 100644 index 000000000000..867118ba8da9 --- /dev/null +++ b/xmlsecurity/inc/xmlsignaturehelper2.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_XMLSECURITY_INC_XMLSIGNATUREHELPER2_HXX +#define INCLUDED_XMLSECURITY_INC_XMLSIGNATUREHELPER2_HXX + +#include <tools/link.hxx> +#include <rtl/ustring.hxx> + +#include <cppuhelper/implbase.hxx> + +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> + +namespace com { +namespace sun { +namespace star { +namespace io { + class XInputStream; } +namespace embed { + class XStorage; } +}}} + +// XUriBinding + +class UriBindingHelper : public cppu::WeakImplHelper< css::xml::crypto::XUriBinding > +{ +private: + css::uno::Reference < css::embed::XStorage > mxStorage; + +public: + UriBindingHelper(); + explicit UriBindingHelper( const css::uno::Reference < css::embed::XStorage >& rxStorage ); + + void SAL_CALL setUriBinding( const OUString& uri, const css::uno::Reference< css::io::XInputStream >& aInputStream ) override; + + css::uno::Reference< css::io::XInputStream > SAL_CALL getUriBinding( const OUString& uri ) override; + + static css::uno::Reference < css::io::XInputStream > OpenInputStream( const css::uno::Reference < css::embed::XStorage >& rxStore, const OUString& rURI ); +}; + +#endif // INCLUDED_XMLSECURITY_INC_XMLSIGNATUREHELPER2_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xsecctl.hxx b/xmlsecurity/inc/xsecctl.hxx index 68968a2bb2f0..a041bd3b7069 100644 --- a/xmlsecurity/inc/xsecctl.hxx +++ b/xmlsecurity/inc/xsecctl.hxx @@ -41,11 +41,12 @@ #include <rtl/ustrbuf.hxx> #include <rtl/ref.hxx> - #include <cppuhelper/implbase.hxx> #include <vector> +#include "xmlsignaturehelper2.hxx" + #define NS_XMLDSIG "http://www.w3.org/2000/09/xmldsig#" #define NS_DC "http://purl.org/dc/elements/1.1/" #define NS_XD "http://uri.etsi.org/01903/v1.3.2#" @@ -219,7 +220,7 @@ public: /* * An xUriBinding is provided to map Uris to XInputStream interfaces. */ - css::uno::Reference< css::xml::crypto::XUriBinding > m_xUriBinding; + rtl::Reference<UriBindingHelper> m_xUriBinding; private: @@ -289,10 +290,7 @@ public: sal_Int32 getNewSecurityId( ); - void startMission( const css::uno::Reference< - css::xml::crypto::XUriBinding >& xUriBinding, - const css::uno::Reference< - css::xml::crypto::XXMLSecurityContext >& xSecurityContext ); + void startMission(const rtl::Reference<UriBindingHelper>& xUriBinding, const css::uno::Reference<css::xml::crypto::XXMLSecurityContext>& xSecurityContext); void setSAXChainConnector(const css::uno::Reference< css::lang::XInitialization >& xInitialization); |