diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-08-18 12:13:39 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-08-18 12:13:39 +0000 |
commit | f6ce9dc506eae5aebe2e48003f9f73446ed91482 (patch) | |
tree | ca51ad0e69c88160299ed20e4771353b9dc3f77f /xmlsecurity/source | |
parent | c6ea261c4425e77ce21bf1d53c5d33292a5b5f68 (diff) |
INTEGRATION: CWS cmcfixes48 (1.28.16); FILE MERGED
2008/08/01 13:54:31 cmc 1.28.16.1: #i92247# remove duplication of object code, link only the single library to libxmlsec1, and update some stuff to new api
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r-- | xmlsecurity/source/helper/xmlsignaturehelper.cxx | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx index c767ba5f4d78..8ef7c21dd39b 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: xmlsignaturehelper.cxx,v $ - * $Revision: 1.28 $ + * $Revision: 1.29 $ * * This file is part of OpenOffice.org. * @@ -46,6 +46,8 @@ #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/security/SerialNumberAdapter.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> #include <tools/date.hxx> #include <tools/time.hxx> @@ -63,12 +65,11 @@ using namespace ::com::sun::star; -XMLSignatureHelper::XMLSignatureHelper( const uno::Reference< lang::XMultiServiceFactory>& rxMSF) - : mxMSF(rxMSF), mbODFPre1_2(false) +XMLSignatureHelper::XMLSignatureHelper( const uno::Reference< uno::XComponentContext >& rxCtx) + : mxCtx(rxCtx), mbODFPre1_2(false) { - mpXSecController = new XSecController; + mpXSecController = new XSecController(rxCtx); mxSecurityController = mpXSecController; - mpXSecController->setFactory( rxMSF ); mbError = false; } @@ -93,11 +94,10 @@ bool XMLSignatureHelper::Init( const rtl::OUString& rTokenPath ) void XMLSignatureHelper::ImplCreateSEInitializer() { - rtl::OUString sSEInitializer; - - sSEInitializer = rtl::OUString::createFromAscii( SEINITIALIZER_COMPONENT ); + rtl::OUString sSEInitializer(rtl::OUString::createFromAscii( SEINITIALIZER_COMPONENT )); + uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); mxSEInitializer = uno::Reference< com::sun::star::xml::crypto::XSEInitializer > ( - mxMSF->createInstance( sSEInitializer ), uno::UNO_QUERY ); + xMCF->createInstanceWithContext( sSEInitializer, mxCtx ), uno::UNO_QUERY ); } void XMLSignatureHelper::SetUriBinding( com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding >& rxUriBinding ) @@ -200,10 +200,10 @@ uno::Reference<xml::sax::XDocumentHandler> XMLSignatureHelper::CreateDocumentHan /* * get SAX writer component */ + uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); uno::Reference< io::XActiveDataSource > xSaxWriter( - mxMSF->createInstance(rtl::OUString::createFromAscii( - "com.sun.star.xml.sax.Writer")), - uno::UNO_QUERY ); + xMCF->createInstanceWithContext(rtl::OUString::createFromAscii( + "com.sun.star.xml.sax.Writer"), mxCtx ), uno::UNO_QUERY ); DBG_ASSERT( xSaxWriter.is(), "can't instantiate XML writer" ); @@ -318,10 +318,12 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe /* * get SAX parser component */ + uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); uno::Reference< xml::sax::XParser > xParser( - mxMSF->createInstance( - rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser") ), + xMCF->createInstanceWithContext( + rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser"), mxCtx ), uno::UNO_QUERY ); + DBG_ASSERT( xParser.is(), "Can't create parser" ); /* @@ -462,6 +464,3 @@ IMPL_LINK( XMLSignatureHelper, StartVerifySignatureElement, const uno::Reference return 0; } - - - |