summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgt <gt@openoffice.org>2004-07-22 05:28:36 +0000
committergt <gt@openoffice.org>2004-07-22 05:28:36 +0000
commit43a9149c4b1cf2113edfb33a17abaf0126a405c7 (patch)
tree8c386d07d7bd50bdb36f57c4794e9de5bca4d8cb
parentc788498d4c94dfca6427aea050e4d7ebafa3d6a5 (diff)
#i20883# config i/o
-rw-r--r--xmlsecurity/source/dialogs/macrosecurity.cxx60
1 files changed, 26 insertions, 34 deletions
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx
index adac3f6f77bc..98892a54c6a7 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: macrosecurity.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: mt $ $Date: 2004-07-22 06:05:18 $
+ * last change: $Author: gt $ $Date: 2004-07-22 06:28:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -119,7 +119,7 @@ IMPL_LINK( MacroSecurity, OkBtnHdl, void*, EMTYARG )
mpLevelTP->ClosePage();
mpTrustSrcTP->ClosePage();
-// ExitDialog( RET_OK );
+ EndDialog( RET_OK );
return 0;
}
@@ -220,7 +220,7 @@ void MacroSecurityLevelTP::ClosePage( void )
}
-IMPL_LINK( MacroSecurityTrustedSourcesTP, AddCertPBHdl, void*, EMTYARG )
+/*IMPL_LINK( MacroSecurityTrustedSourcesTP, AddCertPBHdl, void*, EMTYARG )
{
CertificateChooser aChooser( this, mpDlg->mxSecurityEnvironment, mpDlg->maCurrentSignatureInformations );
if( aChooser.Execute() )
@@ -229,14 +229,12 @@ IMPL_LINK( MacroSecurityTrustedSourcesTP, AddCertPBHdl, void*, EMTYARG )
if( xCert.is() )
{
-// mpDlg->maCurrentSignatureInformations.push_back( ;
-
FillCertLB();
}
}
return 0;
-}
+}*/
IMPL_LINK( MacroSecurityTrustedSourcesTP, ViewCertPBHdl, void*, EMTYARG )
{
@@ -312,6 +310,21 @@ IMPL_LINK( MacroSecurityTrustedSourcesTP, RemoveLocPBHdl, void*, EMTYARG )
{
maTrustFileLocLB.RemoveEntry( nSel );
// remove from sequence
+ sal_Int32 nSeqIndex = ( sal_Int32 ) maTrustCertLB.GetEntry( nSel )->GetUserData();
+
+ sal_Int32 nCnt = maTrustedAuthors.getLength();
+ DBG_ASSERT( nSeqIndex < nCnt, "MacroSecurityTrustedSourcesTP::RemoveLocPBHdl(): impossible state!?" );
+ cssu::Sequence< SvtSecurityOptions::Certificate > aNewSeq( nCnt - 1 );
+ for( sal_Int32 nR = 0, nW = 0 ; nR < nCnt ; ++nR )
+ {
+ if( nR != nSeqIndex )
+ {
+ aNewSeq[ nW ] = maTrustedAuthors[ nR ];
+ ++nW;
+ }
+ }
+
+ maTrustedAuthors = aNewSeq;
}
return 0;
@@ -351,38 +364,17 @@ void MacroSecurityTrustedSourcesTP::FillCertLB( void )
String aCN_Id( String::CreateFromAscii( "CN" ) );
for( sal_uInt32 nEntry = 0 ; nEntry < nCountEntries ; ++nEntry )
{
- cssu::Sequence< ::rtl::OUString >& rEntry = maTrustedAuthors[ nEntry ];
+ cssu::Sequence< ::rtl::OUString >& rEntry = maTrustedAuthors[ nEntry ];
+ uno::Reference< css::security::XCertificate > xCert;
- const SignatureInformation& rInfo = mpDlg->maCurrentSignatureInformations[ nEntry ];
- uno::Reference< css::security::XCertificate > xCert;
+ // create from RawData
+ xCert = mpDlg->mxSecurityEnvironment->createCertificateFromAscii( rEntry[ 2 ] );
SvLBoxEntry* pLBEntry = maTrustCertLB.InsertEntry( XmlSec::GetContentPart( xCert->getSubjectName(), aCN_Id ) );
- maTrustCertLB.SetEntryText( XmlSec::GetContentPart( rInfo.ouX509IssuerName, aCN_Id ), pLBEntry, 1 );
- maTrustCertLB.SetEntryText( XmlSec::GetDateTimeString( rInfo.ouDate, rInfo.ouTime ), pLBEntry, 2 );
+ maTrustCertLB.SetEntryText( XmlSec::GetContentPart( xCert->getIssuerName(), aCN_Id ), pLBEntry, 1 );
+ maTrustCertLB.SetEntryText( XmlSec::GetDateTimeString( xCert->getNotAfter() ), pLBEntry, 2 );
pLBEntry->SetUserData( ( void* ) sal_Int32( nEntry ) ); // missuse user data as index
}
-// m_seqSecureURLs[ nItem ] = aOpt.SubstituteVariable( m_seqSecureURLs[ nItem ] );
-
-/* uno::Reference< css::xml::crypto::XSecurityEnvironment > xSecEnv = mpDlg->maSignatureHelper.GetSecurityEnvironment();
- uno::Reference< css::security::XCertificate > xCert;
-
- String aCN_Id( String::CreateFromAscii( "CN" ) );
- int nInfos = mpDlg->maCurrentSignatureInformations.size();
- for( int n = 0; n < nInfos; ++n )
- {
- const SignatureInformation& rInfo = mpDlg->maCurrentSignatureInformations[n];
- xCert = xSecEnv->getCertificate( rInfo.ouX509IssuerName, numericStringToBigInteger( rInfo.ouX509SerialNumber ) );
-
- if( xCert.is() )
- {
- SvLBoxEntry* pEntry = maTrustCertLB.InsertEntry( XmlSec::GetContentPart( xCert->getSubjectName(), aCN_Id ) );
- maTrustCertLB.SetEntryText( XmlSec::GetContentPart( rInfo.ouX509IssuerName, aCN_Id ), pEntry, 1 );
- maTrustCertLB.SetEntryText( XmlSec::GetDateTimeString( rInfo.ouDate, rInfo.ouTime ), pEntry, 2 );
- pEntry->SetUserData( ( void* ) sal_Int32( n ) ); // missuse user data as index
- }
- }
-
- TrustCertLBSelectHdl( NULL );*/
}
MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP( Window* _pParent, MacroSecurity* _pDlg )