summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-21 10:15:34 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-21 10:07:37 +0000
commit0649622956431e0a1955cb80d1175025401ab5e5 (patch)
treecdaa1ff406d232399d53594ad1a32691402ab665 /xmlsecurity
parentede35e5c693a287f31e3c02d8afd33580e827380 (diff)
loplugin:unusedmethods
Change-Id: I52a9f16f3ed543a3c83ca111df70e3f7ae1ef33c Reviewed-on: https://gerrit.libreoffice.org/34508 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/Library_xsec_fw.mk1
-rw-r--r--xmlsecurity/source/framework/encryptionengine.cxx159
-rw-r--r--xmlsecurity/source/framework/encryptionengine.hxx93
-rw-r--r--xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx4
-rw-r--r--xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx4
-rw-r--r--xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx5
-rw-r--r--xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx4
7 files changed, 2 insertions, 268 deletions
diff --git a/xmlsecurity/Library_xsec_fw.mk b/xmlsecurity/Library_xsec_fw.mk
index 201fc71b9a85..b8ebdb2662a1 100644
--- a/xmlsecurity/Library_xsec_fw.mk
+++ b/xmlsecurity/Library_xsec_fw.mk
@@ -34,7 +34,6 @@ $(eval $(call gb_Library_add_exception_objects,xsec_fw,\
xmlsecurity/source/framework/buffernode \
xmlsecurity/source/framework/elementcollector \
xmlsecurity/source/framework/elementmark \
- xmlsecurity/source/framework/encryptionengine \
xmlsecurity/source/framework/saxeventkeeperimpl \
xmlsecurity/source/framework/securityengine \
xmlsecurity/source/framework/signaturecreatorimpl \
diff --git a/xmlsecurity/source/framework/encryptionengine.cxx b/xmlsecurity/source/framework/encryptionengine.cxx
deleted file mode 100644
index 8cf7d295da5c..000000000000
--- a/xmlsecurity/source/framework/encryptionengine.cxx
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- 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 .
- */
-
-
-#include "encryptionengine.hxx"
-#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <rtl/ref.hxx>
-#include <xmlencryptiontemplateimpl.hxx>
-
-using namespace com::sun::star::uno;
-namespace cssxc = com::sun::star::xml::crypto;
-namespace cssxw = com::sun::star::xml::wrapper;
-
-EncryptionEngine::EncryptionEngine( const Reference<XComponentContext> & xContext)
- :m_xContext(xContext), m_nIdOfBlocker(-1)
-{
-}
-
-bool EncryptionEngine::checkReady() const
-/****** EncryptionEngine/checkReady ******************************************
- *
- * NAME
- * checkReady -- checks the conditions for the main operation.
- *
- * SYNOPSIS
- * bReady = checkReady( );
- *
- * FUNCTION
- * checks whether all following conditions are satisfied:
- * 1. the main operation has't begun yet;
- * 2. the key material is known;
- * 3. the id of the template blocker is known;
- * 4. both the key element and the encryption template
- * are bufferred.
- *
- * RESULT
- * bReady - true if all conditions are satisfied, false otherwise
- ******************************************************************************/
-{
- bool rc = true;
-
- sal_Int32 nKeyInc = 0;
- if (m_nIdOfKeyEC != 0)
- {
- nKeyInc = 1;
- }
-
- if (m_bMissionDone ||
- m_nIdOfKeyEC == -1 ||
- m_nIdOfBlocker == -1 ||
- 1+nKeyInc > m_nNumOfResolvedReferences )
- {
- rc = false;
- }
-
- return rc;
-}
-
-void EncryptionEngine::tryToPerform( )
-/****** EncryptionEngine/tryToPerform ****************************************
- *
- * NAME
- * tryToPerform -- tries to perform the encryption/decryption operation.
- *
- * SYNOPSIS
- * tryToPerform( );
- *
- * FUNCTION
- * if the situation is ready, perform following operations.
- * 1. prepares a encryption template;
- * 2. calls the encryption bridge component;
- * 3. clears up all used resources;
- * 4. notifies the result listener;
- * 5. sets the "accomplishment" flag.
- ******************************************************************************/
-{
- if (checkReady())
- {
- rtl::Reference<XMLEncryptionTemplateImpl> xEncryptionTemplate = new XMLEncryptionTemplateImpl();
-
- Reference< cssxw::XXMLElementWrapper > xXMLElement
- = m_xSAXEventKeeper->getElement( m_nIdOfTemplateEC );
-
- xEncryptionTemplate->setTemplate(xXMLElement);
-
- startEngine(Reference<cssxc::XXMLEncryptionTemplate>(xEncryptionTemplate.get()));
-
- /*
- * done
- */
- clearUp( );
-
- notifyResultListener();
-
- m_bMissionDone = true;
- }
-}
-
-void EncryptionEngine::clearUp( ) const
-/****** EncryptionEngine/clearup *********************************************
- *
- * NAME
- * clearUp -- clear up all resources used by this operation.
- *
- * SYNOPSIS
- * clearUp( );
- *
- * FUNCTION
- * cleaning resources up includes:
- * 1. releases the ElementCollector for the encryption template element;
- * 2. releases the Blocker for the encryption template element;
- * 3. releases the ElementCollector for the key element, if there is one.
- ******************************************************************************/
-{
- Reference < cssxc::sax::XReferenceResolvedBroadcaster >
- xReferenceResolvedBroadcaster( m_xSAXEventKeeper, UNO_QUERY );
-
- xReferenceResolvedBroadcaster->removeReferenceResolvedListener(
- m_nIdOfTemplateEC,
- static_cast<const Reference < cssxc::sax::XReferenceResolvedListener > >(static_cast<SecurityEngine *>(const_cast<EncryptionEngine *>(this))));
-
- m_xSAXEventKeeper->removeElementCollector(m_nIdOfTemplateEC);
-
- if (m_nIdOfBlocker != -1)
- {
- m_xSAXEventKeeper->removeBlocker(m_nIdOfBlocker);
- }
-
- if (m_nIdOfKeyEC != 0 && m_nIdOfKeyEC != -1)
- {
- m_xSAXEventKeeper->removeElementCollector(m_nIdOfKeyEC);
- }
-}
-
-/* XBlockerMonitor */
-void SAL_CALL EncryptionEngine::setBlockerId( sal_Int32 id )
-{
- m_nIdOfBlocker = id;
- tryToPerform();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/framework/encryptionengine.hxx b/xmlsecurity/source/framework/encryptionengine.hxx
deleted file mode 100644
index 33915c5ceb0e..000000000000
--- a/xmlsecurity/source/framework/encryptionengine.hxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- 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_SOURCE_FRAMEWORK_ENCRYPTIONENGINE_HXX
-#define INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_ENCRYPTIONENGINE_HXX
-
-#include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp>
-#include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp>
-#include <com/sun/star/xml/crypto/sax/XBlockerMonitor.hpp>
-#include <com/sun/star/xml/crypto/sax/XKeyCollector.hpp>
-#include <com/sun/star/xml/crypto/sax/XMissionTaker.hpp>
-#include <com/sun/star/xml/crypto/sax/XSAXEventKeeper.hpp>
-#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
-#include <com/sun/star/xml/crypto/XXMLEncryption.hpp>
-#include <cppuhelper/implbase.hxx>
-
-#include "framework/securityengine.hxx"
-
-namespace com { namespace sun { namespace star { namespace uno {
- class XComponentContext;
-} } } }
-
-class EncryptionEngine : public cppu::ImplInheritanceHelper
-<
- SecurityEngine,
- css::xml::crypto::sax::XBlockerMonitor
->
-/****** encryptionEngine.hxx/CLASS encryptionEngine ***************************
- *
- * NAME
- * EncryptionEngine -- Base class of Encryptor and Decryptor
- *
- * FUNCTION
- * Maintains common members and methods related with encryption.
- ******************************************************************************/
-{
-private:
- css::uno::Reference< css::uno::XComponentContext > m_xContext;
-
-protected:
- /*
- * the Encryption bridge component, which performs encrypt and decrypt
- * operation based on xmlsec library.
- */
- css::uno::Reference< css::xml::crypto::XXMLEncryption > m_xXMLEncryption;
-
- /*
- * the Id of template blocker.
- */
- sal_Int32 m_nIdOfBlocker;
-
-protected:
- explicit EncryptionEngine( const css::uno::Reference< css::uno::XComponentContext > & xContext );
- virtual ~EncryptionEngine() override {};
-
- virtual void tryToPerform( ) override;
- virtual void clearUp( ) const override;
- virtual bool checkReady() const override;
-
- /*
- * starts the main function. This method will be implemented by any sub-class.
- * For a Encryptor, it performs encryption operation;
- * for a Decryptor, decryption operation is performed.
- */
- /// @throws css::uno::Exception
- /// @throws css::uno::RuntimeException
- virtual void startEngine( const css::uno::Reference< css::xml::crypto::XXMLEncryptionTemplate >&)
- {};
-
-public:
- /* XBlockerMonitor */
- virtual void SAL_CALL setBlockerId( sal_Int32 id ) override;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx
index 923f4bb73b3a..09201d90679b 100644
--- a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx
+++ b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx
@@ -108,8 +108,4 @@ Reference< XInterface > SAL_CALL XMLEncryptionTemplateImpl::impl_createInstance(
return Reference< XInterface >( *new XMLEncryptionTemplateImpl ) ;
}
-Reference< XSingleServiceFactory > XMLEncryptionTemplateImpl::impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) {
- return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx
index adc92a868d48..a9bbf47eebf4 100644
--- a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx
+++ b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx
@@ -85,9 +85,7 @@ class XMLEncryptionTemplateImpl : public ::cppu::WeakImplHelper<
//Helper for registry
/// @throws css::uno::RuntimeException
static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& aServiceManager ) ;
-
- static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& aServiceManager ) ;
-} ;
+};
#endif // _XMLENCRYPTIONTEMPLATE_XMLSECIMPL_HXX_
diff --git a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx
index 8d85579e4a7b..b117dac54525 100644
--- a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx
+++ b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx
@@ -128,9 +128,4 @@ OUString XMLSignatureTemplateImpl::impl_getImplementationName() {
Reference< XInterface > SAL_CALL XMLSignatureTemplateImpl::impl_createInstance( const Reference< XMultiServiceFactory >& ) {
return Reference< XInterface >( *new XMLSignatureTemplateImpl ) ;
}
-
-Reference< XSingleServiceFactory > XMLSignatureTemplateImpl::impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) {
- return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx
index 62f713aecc6f..1876aeb037a5 100644
--- a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx
+++ b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx
@@ -92,9 +92,7 @@ class XMLSignatureTemplateImpl : public ::cppu::WeakImplHelper<
//Helper for registry
/// @throws css::uno::RuntimeException
static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& aServiceManager ) ;
-
- static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& aServiceManager ) ;
-} ;
+};
#endif // _XMLSIGNATURETEMPLATE_XMLSECIMPL_HXX_