diff options
author | Malte Timmermann <mt@openoffice.org> | 2004-07-21 12:57:52 +0000 |
---|---|---|
committer | Malte Timmermann <mt@openoffice.org> | 2004-07-21 12:57:52 +0000 |
commit | b262c189c5788e98a50dff82013eff7e91a85839 (patch) | |
tree | d188afff0c0410b0dbce1f378109b79d140c106f /xmlsecurity | |
parent | 2d153fbe2e250e95942113b7cbbe01c574f1b2cf (diff) |
#i21596# Digital Signatutres...
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/inc/xmlsecurity/certificateviewer.hxx | 9 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/certificateviewer.cxx | 54 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/certificateviewer.src | 14 |
3 files changed, 59 insertions, 18 deletions
diff --git a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx index 7581ebeb4fe7..2c1b5774b774 100644 --- a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx +++ b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx @@ -2,9 +2,9 @@ * * $RCSfile: certificateviewer.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: gt $ $Date: 2004-07-15 06:19:04 $ + * last change: $Author: mt $ $Date: 2004-07-21 13:57:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -170,12 +170,15 @@ class CertificateViewerCertPathTP : public CertificateViewerTP private: FixedText maCertPathFT; SvTreeListBox maCertPathLB; + PushButton maViewCertPB; FixedText maCertStatusFT; MultiLineEdit maCertStatusML; + DECL_LINK( ViewCertHdl, void* ); DECL_LINK( CertSelectHdl, void* ); void Clear( void ); - SvLBoxEntry* InsertCert( SvLBoxEntry* _pParent, const String& _rName, const String& _rStatus ); + SvLBoxEntry* InsertCert( SvLBoxEntry* _pParent, const String& _rName, cssu::Reference< dcss::security::XCertificate > rxCert ); + public: CertificateViewerCertPathTP( Window* pParent, CertificateViewer* _pDlg ); virtual ~CertificateViewerCertPathTP(); diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 51c699736fd2..bb9737b2f309 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: certificateviewer.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: mt $ $Date: 2004-07-15 09:28:33 $ + * last change: $Author: mt $ $Date: 2004-07-21 13:57:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -407,12 +407,20 @@ IMPL_LINK( CertificateViewerDetailsTP, ElementSelectHdl, void*, EMPTYARG ) return 0; } +struct CertPath_UserData +{ + cssu::Reference< dcss::security::XCertificate > mxCert; + String maStatus; + + CertPath_UserData( cssu::Reference< dcss::security::XCertificate > xCert ) { mxCert = xCert; } +}; CertificateViewerCertPathTP::CertificateViewerCertPathTP( Window* _pParent, CertificateViewer* _pDlg ) :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_CERTPATH ), _pDlg ) ,maCertPathFT ( this, ResId( FT_CERTPATH ) ) ,maCertPathLB ( this, ResId( LB_SIGNATURES ) ) + ,maViewCertPB ( this, ResId( BTN_VIEWCERT ) ) ,maCertStatusFT ( this, ResId( FT_CERTSTATUS ) ) ,maCertStatusML ( this, ResId( ML_CERTSTATUS ) ) { @@ -429,11 +437,9 @@ CertificateViewerCertPathTP::CertificateViewerCertPathTP( Window* _pParent, Cert SvLBoxEntry* pParent = NULL; for( int i = nCnt; i; ) { - pParent = InsertCert( pParent, XmlSec::GetContentPart( pCertPath[ --i ]->getIssuerName(), aCN_Id ), aState ); + pParent = InsertCert( pParent, XmlSec::GetContentPart( pCertPath[ --i ]->getSubjectName(), aCN_Id ), pCertPath[ i ] ); } - InsertCert( pParent, XmlSec::GetContentPart( _pDlg->mxCert->getSubjectName(), aCN_Id ), aState ); - while( pParent ) { maCertPathLB.Expand( pParent ); @@ -442,6 +448,7 @@ CertificateViewerCertPathTP::CertificateViewerCertPathTP( Window* _pParent, Cert FreeResource(); + maViewCertPB.SetClickHdl( LINK( this, CertificateViewerCertPathTP, ViewCertHdl ) ); maCertPathLB.SetSelectHdl( LINK( this, CertificateViewerCertPathTP, CertSelectHdl ) ); // MT->GT: After EA, please move path stuff to ActivatePage() and asure it's only done once. @@ -457,15 +464,38 @@ void CertificateViewerCertPathTP::ActivatePage() { } +IMPL_LINK( CertificateViewerCertPathTP, ViewCertHdl, void*, EMPTYARG ) +{ + SvLBoxEntry* pEntry = maCertPathLB.FirstSelected(); + if( pEntry ) + { + CertificateViewer aViewer( this, mpDlg->mxSecurityEnvironment, ((CertPath_UserData*)pEntry->GetUserData())->mxCert ); + aViewer.Execute(); + } + + return 0; +} + IMPL_LINK( CertificateViewerCertPathTP, CertSelectHdl, void*, EMPTYARG ) { - SvLBoxEntry* pEntry = maCertPathLB.FirstSelected(); - String aStatus; + String aStatus; + + SvLBoxEntry* pEntry = maCertPathLB.FirstSelected(); if( pEntry ) - aStatus = *( ( String* ) pEntry->GetUserData() ); + { + CertPath_UserData* pData = (CertPath_UserData*) pEntry->GetUserData(); + if ( !pData->maStatus.Len() ) + { + // Figure out status... + // pData->maStatus = ... + } + aStatus = pData->maStatus; + } maCertStatusML.SetText( aStatus ); + maViewCertPB.Enable( pEntry && ( pEntry != maCertPathLB.Last() ) ); + return 0; } @@ -476,7 +506,7 @@ void CertificateViewerCertPathTP::Clear( void ) SvLBoxEntry* pEntry = maCertPathLB.GetEntry( i ); while( pEntry ) { - delete ( String* ) pEntry->GetUserData(); + delete ( CertPath_UserData* ) pEntry->GetUserData(); ++i; pEntry = maCertPathLB.GetEntry( i ); } @@ -484,10 +514,10 @@ void CertificateViewerCertPathTP::Clear( void ) maCertPathLB.Clear(); } -SvLBoxEntry* CertificateViewerCertPathTP::InsertCert( SvLBoxEntry* _pParent, const String& _rName, const String& _rStatus ) +SvLBoxEntry* CertificateViewerCertPathTP::InsertCert( SvLBoxEntry* _pParent, const String& _rName, cssu::Reference< dcss::security::XCertificate > rxCert ) { - SvLBoxEntry* pEntry = maCertPathLB.InsertEntry( _rName, _pParent ); - pEntry->SetUserData( ( void* ) new String( _rStatus ) ); + SvLBoxEntry* pEntry = maCertPathLB.InsertEntry( _rName, _pParent ); + pEntry->SetUserData( ( void* ) new CertPath_UserData( rxCert ) ); return pEntry; } diff --git a/xmlsecurity/source/dialogs/certificateviewer.src b/xmlsecurity/source/dialogs/certificateviewer.src index 5505bd5d633d..638c4a32d059 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.src +++ b/xmlsecurity/source/dialogs/certificateviewer.src @@ -2,9 +2,9 @@ * * $RCSfile: certificateviewer.src,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: mt $ $Date: 2004-07-15 09:28:33 $ + * last change: $Author: mt $ $Date: 2004-07-21 13:57:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -344,10 +344,18 @@ TabPage RID_XMLSECTP_CERTPATH Control LB_SIGNATURES { Pos = MAP_APPFONT( CV_COL_0, CV_ROW_0A ); - Size = MAP_APPFONT( CV_CONT_WIDTH, CV_ROW_1-CV_ROW_0A ); + Size = MAP_APPFONT( CV_CONT_WIDTH, CV_ROW_1-CV_ROW_0A - 20 /*HACK MT*/ ); SVLook = TRUE; Border = TRUE; }; + PushButton BTN_VIEWCERT + { + // MT: Gunnar should check positions, also hack above... + Pos = MAP_APPFONT( CV_COL_1-(CV_COL_B-CV_COL_A), CV_ROW_0A+CV_ROW_1-CV_ROW_0A - 20 + 5 ); + Size = MAP_APPFONT( CV_COL_B-CV_COL_A, RSC_CD_PUSHBUTTON_HEIGHT ); + Text = "Zertifikat anzeigen..."; + Text [ en-US ] = "View Certificate..."; + }; FixedText FT_CERTSTATUS { Pos = MAP_APPFONT( CV_COL_0, CV_ROW_2 ); |