summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMalte Timmermann <mt@openoffice.org>2004-07-22 09:34:22 +0000
committerMalte Timmermann <mt@openoffice.org>2004-07-22 09:34:22 +0000
commit7a6083cf2a96b15d660fd0f5e35164726ab2fd6b (patch)
treea48f12b713229e3b114f7c73d6547370db73d6ca /xmlsecurity
parentd82e2ea98f75c8c3d8ee391ea3e2c74b03e64f7f (diff)
#i21596# Digital Signatures...
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx15
-rw-r--r--xmlsecurity/source/helper/xmlsignaturehelper.cxx10
2 files changed, 16 insertions, 9 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index dbfec8d4a5f9..e773404d7736 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: digitalsignaturesdialog.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: mt $ $Date: 2004-07-19 06:45:40 $
+ * last change: $Author: mt $ $Date: 2004-07-22 10:34:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -213,11 +213,18 @@ IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG )
CertificateChooser aChooser( this, xSecEnv, aCurrentSignatureInformations );
if( aChooser.Execute() )
{
+ uno::Reference< ::com::sun::star::security::XCertificate > xCert = aChooser.GetSelectedCertificate();
+ rtl::OUString aCertSerial = bigIntegerToNumericString( xCert->getSerialNumber() );
+ if ( !aCertSerial.getLength() )
+ {
+ DBG_ERROR( "Error in Certificate, problem with serial number!" );
+ return -1;
+ }
+
maSignatureHelper.StartMission();
sal_Int32 nSecurityId = maSignatureHelper.GetNewSecurityId();
- uno::Reference< ::com::sun::star::security::XCertificate > xCert = aChooser.GetSelectedCertificate();
- maSignatureHelper.SetX509Certificate( nSecurityId, xCert->getIssuerName(), bigIntegerToNumericString( xCert->getSerialNumber() ) );
+ maSignatureHelper.SetX509Certificate( nSecurityId, xCert->getIssuerName(), aCertSerial );
std::vector< rtl::OUString > aElements = DocumentSignatureHelper::CreateElementList( mxStore, rtl::OUString(), meSignatureMode );
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index c0f05769ad9d..3809ff3bc13c 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlsignaturehelper.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: mt $ $Date: 2004-07-21 14:31:25 $
+ * last change: $Author: mt $ $Date: 2004-07-22 10:34:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,6 +72,8 @@
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+
#include <tools/date.hxx>
#include <tools/time.hxx>
@@ -98,10 +100,8 @@ XMLSignatureHelper::XMLSignatureHelper( const uno::Reference< lang::XMultiServic
XMLSignatureHelper::~XMLSignatureHelper()
{
- if (mxSEInitializer.is())
- {
+ if ( mxSEInitializer.is() && mxSecurityContext.is() )
mxSEInitializer->freeSecurityContext( mxSecurityContext );
- }
}
bool XMLSignatureHelper::Init( const rtl::OUString& rTokenPath )