ksslinfodlg.cpp
来自「konqueror3 embedded版本, KDE环境下的当家浏览器的嵌入式版」· C++ 代码 · 共 82 行
CPP
82 行
/* This file is part of the KDE project Copyright (C) 2000 Simon Hausmann <hausmann@kde.org> Copyright (C) 2003-2004 Luciano Montanaro <mikelima@cirulla.net> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception this program may be linked with Qt non-commercial edition, the resulting executable be distributed, without including the source code for the Qt non-commercial edition in the source distribution.*/#include "ksslinfodlg.h"#include <qmessagebox.h>#include <ksslx509map.h>#include <klocale.h>KSSLInfoDlg::KSSLInfoDlg( bool secureConnection, QWidget *parent, const char *, bool ){ m_ssl = secureConnection; m_parent = parent;}void KSSLInfoDlg::setSecurityInQuestion(bool) {}void KSSLInfoDlg::setup( KSSLCertificate* c, const QString &ip, const QString & /* url */, const QString &cipher, const QString & /* cipherdesc */, const QString & /* sslversion */, int usedbits, int /* bits */, KSSLCertificate::KSSLValidation certstate){ m_moreInfo = "\n\n"; m_moreInfo += KSSLCertificate::verifyText( certstate ); KSSLX509Map cert(c->getSubject()); QString tmp; if ( !( tmp = cert.getValue( "O" ) ).isEmpty() ) m_moreInfo += i18n( "\nOrganization: %1" ).arg( tmp ); if ( !( tmp = cert.getValue( "L" ) ).isEmpty() ) m_moreInfo += i18n( "\nLocality: %1" ).arg( tmp ); if ( !( tmp = cert.getValue( "ST" ) ).isEmpty() ) m_moreInfo += i18n( "\nState: %1" ).arg( tmp ); if ( !( tmp = cert.getValue( "C" ) ).isEmpty() ) m_moreInfo += i18n( "\nCountry: %1" ).arg( tmp ); if ( !( tmp = cert.getValue( "CN" ) ).isEmpty() ) m_moreInfo += i18n( "\nCommon Name: %1" ).arg( tmp ); m_moreInfo += "\n"; m_moreInfo += i18n( "\nServer IP: %1" ).arg( ip ); m_moreInfo += i18n( "\nCipher: %1" ).arg( cipher ); m_moreInfo += i18n( "\nStrength: %1 bits" ).arg( usedbits );} void KSSLInfoDlg::exec(){ QMessageBox::information( m_parent, i18n( "SSL Information" ), m_ssl ? i18n( "The current connection\n is secured with SSL.%1" ).arg( m_moreInfo ) : i18n( "The current connection\n is not secured with SSL." ) ); delete this;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?