generic: remove unused sources

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-02-27 09:07:35 +02:00
parent 31ee051ff4
commit 73abee8849
20 changed files with 0 additions and 4960 deletions

View file

@ -280,7 +280,6 @@ add_subdirectory( kutils )
add_subdirectory( licenses )
add_subdirectory( mimetypes )
add_subdirectory( plasma )
add_subdirectory( security )
add_subdirectory( solid )
add_subdirectory( threadweaver )

View file

@ -4,11 +4,6 @@ if(NOT Strigi_FOUND)
set(KIO_NO_STRIGI TRUE)
endif()
if(OPENSSL_FOUND)
set(KSSL_HAVE_SSL 1)
include_directories(${OPENSSL_INCLUDE_DIR})
endif()
# This applies to all subdirs; let's put kio's dependencies (and own dirs) here, once and for all
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/bookmarks

View file

@ -1,4 +0,0 @@
if(OPENSSL_FOUND)
# add_subdirectory( crypto )
# add_subdirectory( kcert )
endif(OPENSSL_FOUND)

View file

@ -1,29 +0,0 @@
include_directories(
${OPENSSL_INCLUDE_DIR}
${KDE4_KPARTS_INCLUDES}
${CMAKE_BINARY_DIR}/kio/kssl
${CMAKE_SOURCE_DIR}/kio/kssl
)
set(kcm_crypto_PART_SRCS
crypto.cpp
certexport.cpp
kdatetimedlg.cpp
)
kde4_add_plugin(kcm_crypto ${kcm_crypto_PART_SRCS})
target_link_libraries(kcm_crypto
${KDE4_KIO_LIBS}
${KDE4_KDEUI_LIBS}
${OPENSSL_LIBRARIES}
)
install(
TARGETS kcm_crypto
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
)
install(
FILES crypto.desktop
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
)

View file

@ -1,3 +0,0 @@
#! /usr/bin/env bash
$EXTRACTRC *.ui >> rc.cpp
$XGETTEXT *.cpp *.h -o $podir/kcmcrypto.pot

View file

@ -1,2 +0,0 @@
This needs to be updated to use libkssl instead of OpenSSL directly.

View file

@ -1,158 +0,0 @@
/**
* certexport.cpp
*
* Copyright (c) 2001 George Staikos <staikos@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "certexport.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <QPushButton>
#include <klineedit.h>
#include <kfiledialog.h>
#include <QRadioButton>
#include <QLayout>
#include <QLabel>
#include <QGroupBox>
#include <klocale.h>
#include <kdebug.h>
#include <kmessagebox.h>
#include <ksslall.h>
KCertExport::KCertExport(QWidget *parent)
: KDialog(parent)
{
setButtons(None);
QWidget *widget = new QWidget(this);
setMainWidget(widget);
QGridLayout *grid = new QGridLayout;
widget->setLayout(grid);
setCaption(i18n("X509 Certificate Export"));
QGroupBox *bg = new QGroupBox(i18n("Format"), this);
QVBoxLayout *lay = new QVBoxLayout(bg);
_pem = new QRadioButton(i18n("&PEM"), bg);
lay->addWidget(_pem);
_netscape = new QRadioButton(i18n("&Netscape"), bg);
lay->addWidget(_netscape);
_der = new QRadioButton(i18n("&DER/ASN1"), bg);
lay->addWidget(_der);
_text = new QRadioButton(i18n("&Text"), bg);
lay->addWidget(_text);
grid->addWidget(bg, 0, 0, 5, 4 );
_pem->setChecked(true);
grid->addWidget(new QLabel(i18n("Filename:"), this), 5, 0, 1, 4 );
_filename = new KLineEdit(this);
grid->addWidget(_filename, 6, 0, 1, 5 );
connect(_filename, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged(QString)));
connect(_filename, SIGNAL(returnPressed()), this, SLOT(slotExport()));
_choose = new QPushButton(KIcon("document-open"), QString(), this); // TODO: port to KUrlRequester
grid->addWidget(_choose, 6, 5);
connect(_choose, SIGNAL(clicked()), this, SLOT(slotChoose()));
_exportBut = new QPushButton(i18n("&Export"), this);
grid->addWidget(_exportBut, 8, 4);
connect(_exportBut, SIGNAL(clicked()), this, SLOT(slotExport()));
_exportBut->setEnabled(false);
_cancel = new QPushButton(i18n("&Cancel"), this);
grid->addWidget(_cancel, 8, 5);
connect(_cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
KCertExport::~KCertExport() {
}
void KCertExport::setCertificate(KSSLCertificate *c) {
_c = c;
}
void KCertExport::slotExport() {
QByteArray cert;
QString certt;
if (_filename->text().isEmpty()) return;
if (!_c) {
KMessageBox::sorry(this, i18n("Internal error. Please report to kfm-devel@kde.org."), i18n("SSL"));
return;
}
if (_der->isChecked()) {
cert = _c->toDer();
} else if (_pem->isChecked()) {
cert = _c->toPem();
} else if (_text->isChecked()) {
certt = _c->toText();
} else { // netscape
cert = _c->toNetscape();
}
if ((!_text->isChecked() && cert.size() <= 0) && certt.isEmpty()) {
KMessageBox::error(this, i18n("Error converting the certificate into the requested format."), i18n("SSL"));
reject();
return;
}
QFile outFile(_filename->text());
if (!outFile.open(QIODevice::WriteOnly)) {
KMessageBox::error(this, i18n("Error opening file for output."), i18n("SSL"));
reject();
return;
}
if (_text->isChecked())
outFile.write(certt.toLocal8Bit(), certt.length());
else outFile.write(cert);
outFile.close();
accept();
}
void KCertExport::slotChoose() {
//QString newFile = KFileDialog::getSaveFileName("::x509save", i18n("*.pem|Privacy Enhanced Mail Format\n*.der|DER/ASN1 Format"));
QString newFile = KFileDialog::getSaveFileName(QString(), "application/x-x509-ca-cert");
// Dunno about this one yet
// \n*.ncert|Netscape certificate files");
if (!newFile.isEmpty()) _filename->setText(newFile);
}
void KCertExport::slotTextChanged(const QString& x) {
_exportBut->setEnabled(!x.isEmpty());
}
#include "moc_certexport.cpp"

View file

@ -1,55 +0,0 @@
/**
* certexport.h
*
* Copyright (c) 2001 George Staikos <staikos@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef CERTEXPORT_H
#define CERTEXPORT_H
#include <kdialog.h>
class KLineEdit;
#include <QRadioButton>
#include <QPushButton>
class KSSLCertificate;
class KCertExport : public KDialog
{
Q_OBJECT
public:
KCertExport(QWidget *parent = 0L);
virtual ~KCertExport();
void setCertificate(KSSLCertificate *c);
protected Q_SLOTS:
void slotExport();
void slotChoose();
void slotTextChanged(const QString &);
private:
QPushButton *_exportBut, *_cancel, *_choose;
QRadioButton *_pem, *_netscape, *_der, *_text;
KLineEdit *_filename;
KSSLCertificate *_c;
};
#endif

View file

@ -1,258 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>D_GenCert</class>
<widget class="QDialog" name="D_GenCert">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>465</width>
<height>319</height>
</rect>
</property>
<property name="windowTitle">
<string>Certificate Creation Wizard</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="T_CertType">
<property name="text">
<string>Certificate type:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="L_CertType"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="TextLabel2">
<property name="text">
<string>Passphrase:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KLineEdit" name="E_Passphrase">
<property name="maxLength">
<number>500</number>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="TextLabel2_2">
<property name="text">
<string>Passphrase (verify):</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="KLineEdit" name="E_Passphrase_2">
<property name="maxLength">
<number>500</number>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="TextLabel3">
<property name="text">
<string>Country code:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="KLineEdit" name="LineEdit3">
<property name="maxLength">
<number>2</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="TextLabel4">
<property name="text">
<string>State or province (in full):</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="KLineEdit" name="LineEdit4">
<property name="maxLength">
<number>200</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="TextLabel5">
<property name="text">
<string>City:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="KLineEdit" name="LineEdit4_2">
<property name="maxLength">
<number>200</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="TextLabel6">
<property name="text">
<string>Organization name:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="KLineEdit" name="LineEdit4_2_2">
<property name="maxLength">
<number>200</number>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="TextLabel7">
<property name="text">
<string>Organizational unit/group:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="KLineEdit" name="LineEdit4_2_2_2">
<property name="maxLength">
<number>200</number>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="TextLabel8">
<property name="text">
<string>Full hostname of the server:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="KLineEdit" name="LineEdit4_2_2_2_2">
<property name="maxLength">
<number>200</number>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="TextLabel9">
<property name="text">
<string>Email address:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="KLineEdit" name="LineEdit4_2_2_2_3">
<property name="maxLength">
<number>200</number>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="TextLabel10">
<property name="text">
<string>Days valid:</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="KIntSpinBox" name="SpinBox1">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>365</number>
</property>
<property name="value">
<number>365</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="CheckBox1">
<property name="text">
<string>Self sign</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="TextLabel11">
<property name="text">
<string>Digest:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KComboBox" name="ComboBox2"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="TextLabel12">
<property name="text">
<string>Alias:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="KLineEdit" name="LineEdit19"/>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="CheckBox2">
<property name="text">
<string>Use DSA instead of RSA</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="TextLabel13">
<property name="text">
<string>Bit strength:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="KComboBox" name="ComboBox5"/>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KIntSpinBox</class>
<extends>QSpinBox</extends>
<header>knuminput.h</header>
</customwidget>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

File diff suppressed because it is too large Load diff

View file

@ -1,238 +0,0 @@
[Desktop Entry]
Icon=preferences-desktop-cryptography
Type=Service
X-KDE-ServiceTypes=KCModule
Exec=kcmshell4 crypto
X-DocPath=kcontrol/crypto/index.html
X-KDE-Library=kcm_crypto
X-KDE-ParentApp=kcontrol
Name=Crypto
Name[af]=Crypto
Name[ar]=التشفير
Name[as]=Crypto
Name[ast]=Cifráu
Name[be@latin]=Šyfravańnie
Name[bg]=Шифриране
Name[bn]=ি
Name[bn_IN]=Crypto
Name[bs]=Šifrovanje
Name[ca]=Criptografia
Name[ca@valencia]=Criptografia
Name[cs]=Šifrování
Name[csb]=Crypto
Name[da]=Kryptering
Name[de]=Krypto
Name[el]=Κρυπτογράφηση
Name[en_GB]=Crypto
Name[eo]=Crypto
Name[es]=Criptografía
Name[et]=Krüpto
Name[eu]=Kriptografia
Name[fa]=رمز
Name[fi]=Salaukset
Name[fr]=Chiffrement
Name[fy]=Crypto
Name[ga]=Crypto
Name[gl]=Criptografía
Name[gu]=
Name[he]=הצפנה
Name[hi]=ि
Name[hne]=ि
Name[hr]=Crypto
Name[hsb]=Crypto
Name[hu]=Titkosítás
Name[hy]=Ծպտյալ
Name[ia]=Crypto
Name[id]=Crypto
Name[is]=Dulkóðun
Name[it]=Crittografia
Name[ja]=
Name[kk]=Crypto
Name[km]=Crypto
Name[kn]=ಿ
Name[ko]=
Name[ku]=Veşartî
Name[lt]=Šifravimas
Name[lv]=Kriptogrāfija
Name[mai]=ि
Name[mk]=Криптографија
Name[ml]=ി
Name[mr]=ि
Name[nb]=Kryptering
Name[nds]=Crypto
Name[ne]=
Name[nl]=Crypto
Name[nn]=Kryptotenester
Name[or]=
Name[pa]=ਿ
Name[pl]=Kryptografia
Name[pt]=Cifra
Name[pt_BR]=Criptografia
Name[ro]=Cripto
Name[ru]=Шифрование
Name[se]=Krypteren
Name[si]=Crypto
Name[sk]=Šifrovanie
Name[sl]=Šifriranje
Name[sq]=Crypto
Name[sr]=Шифровање
Name[sr@ijekavian]=Шифровање
Name[sr@ijekavianlatin]=Šifrovanje
Name[sr@latin]=Šifrovanje
Name[sv]=Krypto
Name[ta]=Crypto
Name[tg]=Рамзгузорӣ
Name[th]=
Name[tr]=Şifreleme
Name[tt]=Шифрлау
Name[ug]=شىفىرلا
Name[uk]=Шифрування
Name[vi]=Mt mã
Name[wa]=Criptografeye
Name[x-test]=xxCryptoxx
Name[zh_CN]=
Name[zh_TW]=Crypto
Comment=Configure SSL, manage certificates, and other cryptography settings
Comment[af]=Konfigureer SSL, hanteer sertifikate, en ander kriptografieverstellings
Comment[ar]=اضبط SSL، وأدر الشهادات وإعدادات تشفير أخرى
Comment[as]=SSL ি , ি , িি
Comment[ast]=Configurar SSL, xestionar certificaos, y otros axustes criptográficos
Comment[be@latin]=Naładžvaje SSL, kiruje sertyfikatami, inšyja nałady šyfravańnia
Comment[bg]=SSL, управление на сертификати и други настройки за шифроване
Comment[bn]=-- ি, িি , িি ি
Comment[bn_IN]=SSL ি, িি ি িি িি ি ি
Comment[bs]=Podešavanje SSLa, upravljanje sertifikatima, i druge kriptografske postavke
Comment[ca]=Configura l'SSL, gestiona certificats, i altres arranjaments de criptografia
Comment[ca@valencia]=Configura l'SSL, gestiona certificats, i altres arranjaments de criptografia
Comment[cs]=Nastavení SSL, správa certifikátů a ostatní nastavení šifrování
Comment[csb]=Kònfigùracëjô SSL, sprôwianié certifikatama ë jinszëma ùstôwóma kriptografiji
Comment[da]=Konfigurér SSL, håndtér certifikater og andre kryptografiske indstillinger
Comment[de]=Einrichtung von SSL, Zertifikat-Verwaltung und weitere kryptografische Einstellungen
Comment[el]=Ρύθμιση SSL, διαχείριση πιστοποιητικών, και άλλες ρυθμίσεις κρυπτογραφίας
Comment[en_GB]=Configure SSL, manage certificates and other cryptography settings
Comment[eo]=Agordi SSLon, administri atestilojn, kaj aliajn kriptografiajn agordojn
Comment[es]=Configurar SSL, gestionar certificados y otras preferencias de criptografía
Comment[et]=SSL-i seadistamine, sertifikaatide haldamine ja muud krüptoseadistused
Comment[eu]=SSL konfiguratu, ziurtagiriak kudeatu eta bestelako kriptografiako ezarpenak
Comment[fa]=پیکربندی SSL، مدیریت گواهینامهها، و تنظیمات رمزنگاری دیگر
Comment[fi]=Muokkaa SSL-asetuksia ja hallitse varmenteita sekä muita salausasetuksia
Comment[fr]=Configure le chiffrement SSL, gère les certificats et autres paramètres liés au chiffrement
Comment[fy]=Stel SSL yn, behear sertifikaten en konfigurearje oare kryptografyske ynstellings
Comment[ga]=Cumraigh SSL, bainistigh teastais, agus socruithe cripteagrafaíochta eile
Comment[gl]=Configurar o SSL, xestionar os certificados e outras opcións de cifrado
Comment[gu]=SSL ,
Comment[he]=שינוי הגדרות SSL, ניהול תעודות והגדרות הצפנה אחרות
Comment[hi]= ि, , िि ि
Comment[hne]= ि, , ि ि
Comment[hr]=Podešavanje SSL-a, upravljanje certifikatima i ostala kriptografska podešavanja
Comment[hsb]=Konfigurowanje SSL, zastaranje certifikatow a druhe kryptografiske nastajenja
Comment[hu]=SSL beállítások, tanúsítványkezelés és további titkosítási lehetőségek
Comment[hy]=Կարգավորել SSL-ը, կառավարել վկայականները, եւ այլ ծածկագիտության կարգավորումներ
Comment[ia]=Configura SSL, manea certificatos e altere fixationes cryptographic
Comment[id]=Konfigurasi SSL, atur sertifikat, dan pengaturan kriptografi lainnya
Comment[is]=Stilla SSL, stýra skírteinum, og aðrar dulkóðunarstillingar
Comment[it]=Configura SSL, gestisce i certificati ed altre impostazioni di crittografia
Comment[ja]=SSL
Comment[kk]=SSL баптаулары, күаліктерді басқару және басқа криптография параметрлері
Comment[km]= SSL,
Comment[kn]=SSL ಿ, ಿಿ, ಿಿ (ಿಿ)
Comment[ko]=SSL ,
Comment[ku]=SSL, rêveberê belge kirinê, û mîhengên din yê bişîfre kirinê veava bike
Comment[lt]=Derina SSL, tvarko liudijimus ir kitus šifravimo parametrus
Comment[lv]=Konfigurēt SSL, pārvaldīt sertifikātus un citus kriptogrāfijas iestatījumus
Comment[mai]= ि , िि ि ि
Comment[mk]=Конфигурација на SSL, менаџмент на сертификати\nи други криптографски поставувања
Comment[ml]= ി, ി, ി ിി
Comment[mr]=SSL, , िि
Comment[nb]=Oppsett av SSL, behandling av sertifikater og andre innstillinger for kryptering
Comment[nds]=SSL inrichten, Zertifikaten plegen un anner Verslötel-Instellen
Comment[ne]=SSL ि, , ि ि
Comment[nl]=Stel SSL in, beheer certificaten en configureer andere cryptografische instellingen
Comment[nn]=Set opp SSL, sertifikat og andre krypteringsinnstillingar
Comment[or]=SSL ି , ି, ିି
Comment[pa]=SSL , ਿ , ਿ ਿ
Comment[pl]=Ustawienia SSL, zarządzanie certyfikatami i inne ustawienia kryptografii
Comment[pt]=Configurar o SSL, gerir os certificados e outras opções de criptografia
Comment[pt_BR]=Configura SSL, gerencia certificados e outras configurações de criptografia
Comment[ro]=Configurează SSL, administrează certificate și alte setări criptografice
Comment[ru]=Настройка SSL, управление сертификатами и другие параметры криптографии
Comment[se]=Gieđahala SSL, sertifikáhtaid ja eará krypterenheivehusaid
Comment[si]=SSL ,
Comment[sk]=Nastavenie SSL, správa certifikátov a ostatné nastavenie šifrovania
Comment[sl]=Nastavljanje SSL, upravljanje s potrdili in druge nastavitve šifriranja
Comment[sr]=Подешавање ССЛа, управљање сертификатима, и друге криптографске поставке
Comment[sr@ijekavian]=Подешавање ССЛа, управљање сертификатима, и друге криптографске поставке
Comment[sr@ijekavianlatin]=Podešavanje SSLa, upravljanje sertifikatima, i druge kriptografske postavke
Comment[sr@latin]=Podešavanje SSLa, upravljanje sertifikatima, i druge kriptografske postavke
Comment[sv]=Anpassa SSL, hantera certifikat och andra kryptografiska inställningar
Comment[ta]=SSL ி, ிி,
Comment[tg]=Танзимоти SSL, идоракунии иҷозатномаҳо ва танзимотҳои рамзгузории дигар
Comment[th]= SSL, ,
Comment[tr]=SSL yapılandırması, sertifika yönetimi ve diğer şifreleme ayarları
Comment[tt]=SSL'ны көйләү, таныклыклар белән идарә итө һәм криптографиянең башка параметрлары
Comment[ug]=SSL سەپلىمە، گۇۋاھنامە باشقۇرۇش ۋە باشقا شىفىرلاش تەڭشىكى
Comment[uk]=Налаштування SSL, керування сертифікатами та інші параметри шифрування
Comment[vi]=Cu hình SSL, qun lý chng nhn và các thiết lp mt mã khác
Comment[wa]=Apontyî SSL, manaedjî les acertineures, eyet ds ôtes apontiaedjes del criptografeye
Comment[x-test]=xxConfigure SSL, manage certificates, and other cryptography settingsxx
Comment[zh_CN]= SSL
Comment[zh_TW]= SSL
X-KDE-Keywords=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security
X-KDE-Keywords[ar]=تشفير,كريبتو,التشفير,التشفير,SSL,https,الشهادات,الأصفار,TLS.سري,أمني
X-KDE-Keywords[bg]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security,криптография,шифриране,удостоверения,сертификати,шифри,сигурност
X-KDE-Keywords[bs]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security,sigurnost,šifra,kriptografija,certifikati
X-KDE-Keywords[ca]=Cripto,Krypto,Criptografia,encriptatge,SSL,https,certificats,xifres,TLS,segur,seguretat
X-KDE-Keywords[ca@valencia]=Cripto,Krypto,Criptografia,encriptatge,SSL,https,certificats,xifres,TLS,segur,seguretat
X-KDE-Keywords[cs]=Crypto,Krypto,Kryptografie,šifrování,SSL,https,certifikáty,šifry,TLS,zabezpečit,bezpečnost
X-KDE-Keywords[da]=Crypto,Krypto,Kryptografi,kryptering,SSL,https,certifikater,chiffre,TLS,sikker,sikkerhed
X-KDE-Keywords[de]=crypto,krypto,kryptographie,verschlüsselung,ssl,https,Zertifikate,Chiffren,tls,sicher,sicherheit
X-KDE-Keywords[el]=Crypto,Krypto,Κρυπτογράφηση,Κρυπτογραφία,SSL,https,πιστοποιητικά,κωδικοποίηση,TLS,ασφάλιση,ασφάλεια
X-KDE-Keywords[en_GB]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security
X-KDE-Keywords[es]=Crypto,Krypto,Criptografía,cifrado,SSL,ttps,certificados,cifradores,TLS,seguro,seguridad
X-KDE-Keywords[et]=krüpto,krüptograafia,krüptimine,SSL,https,sertifikaadid,serdid,šifrid,TLS,turvalisus,turve
X-KDE-Keywords[eu]=Crypto,Kripto,Kriptografia,zifraketa,SSL,https,ziurtagiriak,zifratzaileak,TLS,seguru,segurtasun
X-KDE-Keywords[fi]=Crypto,Krypto,Salaus,SSL,https,varmenteet,sertifikaatit,salakirjoitukset,salakirjoitus,salakirjoitusmenetelmät,salausmenetelmät,TLS,turvallinen,turvallisuus
X-KDE-Keywords[fr]=Chiffrement, Krypto, déchiffrement, SSL, https, certificats, encodage, TLS, sécuriser, sécurité
X-KDE-Keywords[ga]=Crypto,Krypto,cripteagrafaíocht,criptiú,SSL,https,teastais,sifir,TLS,daingean,slándáil
X-KDE-Keywords[gl]=Cripto,Kripto,Criptografía,cifrado,SSL,https,certificados,cifras,TLS,seguro,securidade
X-KDE-Keywords[gu]=,િ,િ,િ,SSL,https,,,TLS,,
X-KDE-Keywords[he]=הצפנה,קריפטולוגיה,אבטחה,מאובטחCrypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security
X-KDE-Keywords[hu]=Titkosítás,Titkosítás,Titkosítás,titkosítás,SSL,https,tanúsítványok,titkosítók,TLS,biztonságos,biztonság
X-KDE-Keywords[hy]=Ծպտյալ,Krypto,ծածկագիտություն,կոդավորում,SSL,հttps,վկայականներ,ծածկագիր,TLS,ապահով,ապահովություն
X-KDE-Keywords[ia]=Crypto,Krypto,Cryptographia,cryptation,SSL,https,certificatos,ciphras,TLS, secur,securitate
X-KDE-Keywords[id]=Crypto,Kripto,Kriptografi,enkripsi,SSL,https,sertifikat,pemecahan,TLS,aman,keamanan
X-KDE-Keywords[is]=Crypto,Krypto,dulritun,dulkóðun,SSL,https,skilríki,ciphers,TLS,öruggt,öryggi
X-KDE-Keywords[it]=Cripto,Kripto,Crittografia,cifratura,SSL,https,certificati,cifrari,TLS,sicuro,sicurezza
X-KDE-Keywords[kk]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security
X-KDE-Keywords[km]=,,,,SSL,https,,ciphers,TLS,,
X-KDE-Keywords[ko]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security,,,,
X-KDE-Keywords[mr]=ि, , ि , , SSL, https, , , TLS, ि,
X-KDE-Keywords[nb]=Krypto,Crypto,Kryptografi,kryptering,SSL,https,sertifikater,chiffre,TLS,sikker,sikkerhet
X-KDE-Keywords[nds]=Verslöteln,SSL,https,Zertifikaten,Slötels,TLS,seker,Sekerheit
X-KDE-Keywords[nl]=Crypto,Krypto,cryptografie,versleuteling,SSL,https,certificaten,ciphers,TLS,veilig,beveiliging
X-KDE-Keywords[pa]=ਿ,ਿ,ਿ,ਿ,ਿ,,ਿ,ਿ,Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security
X-KDE-Keywords[pl]=Kryptografia,szyfrowanie,SSL,https,certyfikaty,szyfry,TLS,bezpieczeństwo,zabezpiecz
X-KDE-Keywords[pt]=Cripto,Criptografia,encriptação,SSL,HTTPS,certificados,cifras,TLS,seguro,segurança
X-KDE-Keywords[pt_BR]=criptografia,Krypto,criptografar,SSL,HTTPS,certificados,cifras,TLS,segurar,segurança
X-KDE-Keywords[ro]=Criptare,Cripto,Criptografie,SSL,https,certificate,cifru,TLS,sigur,securitate
X-KDE-Keywords[ru]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security,криптография,безопасность,защита,защищенный,защищённый,шифрование,сертификат
X-KDE-Keywords[sk]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security
X-KDE-Keywords[sl]=Šifriranje,šifre,šifra,SSL,HTTPS,potrdila,TLS,varnost
X-KDE-Keywords[sr]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security,криптографија,шифровање,ССЛ,ХТТПС,сертификат,шифрар,ТЛС,безбедност
X-KDE-Keywords[sr@ijekavian]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security,криптографија,шифровање,ССЛ,ХТТПС,сертификат,шифрар,ТЛС,безбедност
X-KDE-Keywords[sr@ijekavianlatin]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security,kriptografija,šifrovanje,SSL,HTTPS,sertifikat,šifrar,TLS,bezbednost
X-KDE-Keywords[sr@latin]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security,kriptografija,šifrovanje,SSL,HTTPS,sertifikat,šifrar,TLS,bezbednost
X-KDE-Keywords[sv]=Krypto,Kryptografi,kryptering,SSL,https,certifikat,chiffer,TLS,säker,säkerhet
X-KDE-Keywords[tg]=Crypto,Krypto,Cryptography,рамзгузорӣ,SSL,https,иҷозатномаҳо,ciphers,TLS,бехатар,амният
X-KDE-Keywords[tr]=Şifre,Şifre,Şifreleme,şifreleme,SSL,https,sertifikalar,şifrelemeler,TLS,güvenli,güvenlik
X-KDE-Keywords[ug]=Crypto,Krypto,Cryptography,شىفىرلاش,SSL,https,گۇۋاھنامە,ciphers,TLS,بىخەتەر,بىخەتەرلىك
X-KDE-Keywords[uk]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security,криптографія,шифрування,сертифікат,сертифікати,захист,безпека,безпечний,захищений
X-KDE-Keywords[vi]=Crypto,mt mã,mã hoá,Krypto,Cryptography,encryption,SSL,https,certificates,chng thc,ciphers,TLS,secure,bo mt,security
X-KDE-Keywords[x-test]=xxCrypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,securityxx
X-KDE-Keywords[zh_CN]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security,,,,
X-KDE-Keywords[zh_TW]=Crypto,Krypto,Cryptography,encryption,SSL,https,certificates,ciphers,TLS,secure,security
Categories=Qt;KDE;X-KDE-settings-security;

View file

@ -1,360 +0,0 @@
/**
* crypto.h
*
* Copyright (c) 2000-2005 George Staikos <staikos@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef CRYPTO_H
#define CRYPTO_H
#include <ksslconfig.h>
#include <ksslall.h>
#include <klocale.h>
#include <QCheckBox>
#include <QDateTime>
#include <QTreeWidget>
#include <QLabel>
#include <kcmodule.h>
#include <kconfig.h>
#include <QGridLayout>
#include <QRadioButton>
#include <QGroupBox>
#include <QButtonGroup>
class KComboBox;
class KCryptoConfig;
class KLineEdit;
class KPushButton;
class KSslCertificateBox;
class KSSLSigners;
class KTabWidget;
class KUrlLabel;
class KUrlRequester;
class CipherItem : public QTreeWidgetItem
{
public:
CipherItem( QTreeWidget *view, const QString& cipher, int bits, int maxBits,
KCryptoConfig *module );
~CipherItem() {}
void setCipher( const QString& cipher ) { m_cipher = cipher; }
const QString& cipher() const { return m_cipher; }
void setBits( int bits ) { m_bits = bits; }
int bits() const { return m_bits; }
QString configName() const;
protected:
virtual void stateChange( bool );
private:
int m_bits;
QString m_cipher;
KCryptoConfig *m_module; // just to call configChanged()
};
class OtherCertItem : public QTreeWidgetItem
{
public:
OtherCertItem(QTreeWidget *view, const QString& sub, const QString& md5, bool perm, int policy, QDateTime exp, KCryptoConfig *module );
~OtherCertItem() {}
QString configName() const;
const QString& getSub() { return _sub; }
int getPolicy() const { return _policy; }
const QString& getMD5() { return _md5; }
bool isPermanent() { return _perm; }
QDateTime getExpires() { return _exp; }
void setPolicy(int x) { _policy = x; }
void setPermanent(bool x) { _perm = x; }
void setExpires(QDateTime x) { _exp = x; }
protected:
virtual void stateChange( bool );
private:
QString _sub, _md5;
KCryptoConfig *m_module; // just to call configChanged()
QDateTime _exp;
bool _perm;
int _policy;
};
class YourCertItem : public QTreeWidgetItem
{
public:
YourCertItem(QTreeWidget *view, QString pkcs, QString pass, QString name, KCryptoConfig *module );
~YourCertItem() {}
QString configName() const;
QString& getPKCS() { return _pkcs; }
void setPKCS(QString pkcs) { _pkcs = pkcs; }
QString& getPass() { return _pass; }
void setPass(QString pass) { _pass = pass; }
QString& getName() { return _name; }
void setName(const QString &name) { _name = name; }
QString& getPassCache() { return _cpass; }
void setPassCache(QString pass) { _cpass = pass; }
protected:
virtual void stateChange( bool );
private:
QString _pkcs;
QString _pass;
QString _cpass;
QString _name;
KCryptoConfig *m_module; // just to call configChanged()
};
class CAItem : public QTreeWidgetItem
{
public:
CAItem(QTreeWidget *view, QString name, QString cert, bool site, bool email, bool code, KCryptoConfig *module );
~CAItem() {}
QString configName() const;
QString& getName() { return _name; }
void setName(QString name) { _name = name; }
inline QString getCert() const { return _cert; }
inline bool getSite() const { return _site; }
inline bool getEmail() const { return _email; }
inline bool getCode() const { return _code; }
inline void setSite(bool x) { _site = x; }
inline void setEmail(bool x) { _email = x; }
inline void setCode(bool x) { _code = x; }
bool isNew, modified;
protected:
virtual void stateChange( bool );
private:
QString _name;
QString _cert;
bool _site, _email, _code;
KCryptoConfig *m_module; // just to call configChanged()
};
class HostAuthItem : public QTreeWidgetItem
{
public:
HostAuthItem(QTreeWidget *view, const QString &host, const QString &name, KCryptoConfig *module ) : QTreeWidgetItem(view) {
_name = name; _host = host;
m_module = module;
setText(0, _host);
setText(1, _name);
_oname.clear();
}
~HostAuthItem() {}
void setAction(KSSLCertificateHome::KSSLAuthAction aa) {
_aa = aa;
switch (aa) {
case KSSLCertificateHome::AuthSend:
setText(2, i18n("Send"));
break;
case KSSLCertificateHome::AuthDont:
setText(2, i18n("Don't Send"));
break;
case KSSLCertificateHome::AuthPrompt:
setText(2, i18n("Prompt"));
break;
default:
break;
}
}
KSSLCertificateHome::KSSLAuthAction getAction() const { return _aa; }
QString configName() const { return _host; }
QString getCertName() const { return _name; }
void setCertName(const QString &name) { _name = name; setText(1, name); }
void setHost(const QString &name) { _host = name; setText(0, name); }
void setOriginalName(const QString &oname) { _oname = oname; }
QString originalName() const { return _oname; }
protected:
private:
QString _host;
QString _name, _oname;
KSSLCertificateHome::KSSLAuthAction _aa;
KCryptoConfig *m_module; // just to call configChanged()
};
class KCryptoConfig : public KCModule
{
Q_OBJECT
public:
explicit KCryptoConfig(QWidget *parent = 0L, const QVariantList &list = QVariantList());
virtual ~KCryptoConfig();
void load();
void save();
void defaults();
#ifdef KSSL_HAVE_SSL
bool loadCiphers();
#endif
public Q_SLOTS:
void configChanged();
void slotGeneratePersonal();
void slotUseEGD();
void slotUseEFile();
void slotSelectCipher(int id);
void slotTestOSSL();
void slotExportCert();
void slotRemoveCert();
void slotVerifyCert();
void slotOtherCertSelect();
void slotPolicyChanged(int id);
void slotPermanent();
void slotUntil();
void slotDatePick();
void slotYourImport();
void slotYourExport();
void slotYourVerify();
void slotYourRemove();
void slotYourUnlock();
void slotYourPass();
void slotYourCertSelect();
void slotNewHostAuth();
void slotRemoveHostAuth();
void slotAuthItemChanged();
void slotAuthText(const QString &t);
void slotAuthButtons();
void slotAuthCombo();
void slotCAImport();
void slotCARemove();
void slotCARestore();
void slotCAItemChanged();
void slotCAChecked();
protected:
void cwUS();
void cwExp();
void cwAll();
private:
void offerImportToKMail( const QString& certFile );
void setAuthCertLists();
void genCAList();
KTabWidget *tabs;
QWidget *tabSSL, *tabOSSL;
QWidget *tabYourSSLCert, *tabOtherSSLCert, *tabSSLCA, *tabSSLCOpts, *tabAuth;
QTreeWidget *SSLv3Box;
QCheckBox *mWarnOnEnter, *mWarnOnLeave;
/* EGD stuff */
QLabel *mEGDLabel;
KUrlRequester *mEGDPath;
QCheckBox *mUseEGD;
QCheckBox *mUseEFile;
/* CipherWizards */
QPushButton *mCWall, *mCWus, *mCWexp, *mCWcompatible;
QCheckBox *mWarnOnUnencrypted, *mWarnOnMixed;
QTreeWidget *yourSSLBox, *otherSSLBox, *caList;
QCheckBox *mWarnSelfSigned, *mWarnExpired, *mWarnRevoked;
QPushButton *macAdd, *macRemove;
KPushButton *macClear;
QTreeWidget *macBox;
QPushButton *otherSSLExport, *otherSSLView, *otherSSLRemove, *otherSSLVerify;
QPushButton *yourSSLImport, *yourSSLPass, *yourSSLRemove, *yourSSLExport,
*yourSSLUnlock, *yourSSLVerify;
QRadioButton *yourSSLUseDefault, *yourSSLList, *yourSSLDont;
KLineEdit *macCert;
KSslCertificateBox *oSubject, *oIssuer;
KSslCertificateBox *ySubject, *yIssuer;
QButtonGroup *policyGroup;
QGroupBox *policyGroupBox;
QButtonGroup *cacheGroup;
QGroupBox *cacheGroupBox;
QRadioButton *policyAccept, *policyReject, *policyPrompt;
QRadioButton *cacheUntil, *cachePerm;
QLabel *fromLabel, *untilLabel;
QLabel *validFrom, *validUntil;
QLabel *yValidFrom, *yValidUntil;
KUrlLabel *untilDate;
QGroupBox *oInfo;
KUrlRequester *oPath;
QPushButton *oTest;
QList<OtherCertItem*> otherCertDelList;
QList<YourCertItem*> yourCertDelList;
QList<CAItem*> caDelList;
/* Personal Cert Policies tab */
KComboBox *defCertBox;
KComboBox *hostCertBox;
QButtonGroup *defCertBG;
QButtonGroup *hostCertBG;
QGroupBox *hostCertGroupBox;
QRadioButton *defSend, *defPrompt, *defDont;
QRadioButton *hostSend, *hostPrompt, *hostDont;
QTreeWidget *hostAuthList;
QPushButton *authAdd, *authRemove;
KLineEdit *authHost;
QList<HostAuthItem*> authDelList;
QLabel *yHash, *pHash;
/* CA stuff */
KSslCertificateBox *caSubject, *caIssuer;
QPushButton *caSSLImport, *caSSLRemove, *caSSLRestore;
QCheckBox *caSite, *caEmail, *caCode;
KSSLSigners *_signers;
QLabel *cHash;
KConfig *config;
KConfig *policies, *pcerts, *authcfg;
KConfig *cacfg;
bool ___lehack; // to hack around a lineedit problem
};
#endif

View file

@ -1,120 +0,0 @@
/**
* kdatetimedlg.cpp
*
* Copyright (c) 2001 George Staikos <staikos@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kdatetimedlg.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <QLayout>
#include <QLabel>
#include <klocale.h>
#include <kdebug.h>
#include <kdatepicker.h>
#include <kpushbutton.h>
#include <knuminput.h>
#include <kstandardguiitem.h>
KDateTimeDlg::KDateTimeDlg(QWidget *parent)
: KDialog(parent)
{
QWidget *widget = new QWidget(this);
setMainWidget(widget);
QGridLayout *grid = new QGridLayout;
setButtons(Ok|Cancel);
widget->setLayout(grid);
setCaption(i18nc("Select Time and Date", "Date & Time Selector"));
_date = new KDatePicker(this);
grid->addWidget(_date, 0, 0, 6, 6);
grid->addWidget(new QLabel(i18nc("Set Hours of Time", "Hour:"), this), 7, 0);
_hours = new KIntNumInput(this);
_hours->setRange(0, 23, 1);
_hours->setSliderEnabled(false);
grid->addWidget(_hours, 7, 1);
grid->addWidget(new QLabel(i18nc("Set Minutes of Time", "Minute:"), this), 7, 2);
_mins = new KIntNumInput(this);
_mins->setRange(0, 59, 1);
_mins->setSliderEnabled(false);
grid->addWidget(_mins, 7, 3);
grid->addWidget(new QLabel(i18nc("Set Seconds of Time", "Second:"), this), 7, 4);
_secs = new KIntNumInput(this);
_secs->setRange(0, 59, 1);
_secs->setSliderEnabled(false);
grid->addWidget(_secs, 7, 5);
}
KDateTimeDlg::~KDateTimeDlg() {
}
QDate KDateTimeDlg::getDate() {
return _date->date();
}
QTime KDateTimeDlg::getTime() {
QTime rc(_hours->value(), _mins->value(), _secs->value());
return rc;
}
QDateTime KDateTimeDlg::getDateTime() {
QDateTime qdt;
QTime qtime(_hours->value(), _mins->value(), _secs->value());
qdt.setDate(_date->date());
qdt.setTime(qtime);
return qdt;
}
void KDateTimeDlg::setDate(const QDate& qdate) {
_date->setDate(qdate);
}
void KDateTimeDlg::setTime(const QTime& qtime) {
_hours->setValue(qtime.hour());
_mins->setValue(qtime.minute());
_secs->setValue(qtime.second());
}
void KDateTimeDlg::setDateTime(const QDateTime& qdatetime) {
_date->setDate(qdatetime.date());
_hours->setValue(qdatetime.time().hour());
_mins->setValue(qdatetime.time().minute());
_secs->setValue(qdatetime.time().second());
}
#include "moc_kdatetimedlg.cpp"

View file

@ -1,59 +0,0 @@
/**
* kdatetimedlg.h
*
* Copyright (c) 2001 George Staikos <staikos@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KDATETIMEDLG_H
#define KDATETIMEDLG_H
#include <kdialog.h>
class KDatePicker;
class KIntNumInput;
class KPushButton;
#include <QDate>
#include <QTime>
#include <QDateTime>
class KDateTimeDlgPrivate;
class KDateTimeDlg : public KDialog
{
Q_OBJECT
public:
KDateTimeDlg(QWidget *parent = 0L);
virtual ~KDateTimeDlg();
virtual QTime getTime();
virtual QDate getDate();
virtual QDateTime getDateTime();
virtual void setDate(const QDate& qdate);
virtual void setTime(const QTime& qtime);
virtual void setDateTime(const QDateTime& qdatetime);
protected Q_SLOTS:
private:
KDatePicker *_date;
KIntNumInput *_hours, *_mins, *_secs;
KDateTimeDlgPrivate *d;
};
#endif

View file

@ -1,28 +0,0 @@
project(kcert)
include_directories(
${OPENSSL_INCLUDE_DIR}
${KDE4_KPARTS_INCLUDES}
${CMAKE_BINARY_DIR}/kio/kssl
${CMAKE_SOURCE_DIR}/kio/kssl
${KDE4_KIO_INCLUDES}
)
kde4_add_plugin(kcertpart kcertpart.cc)
target_link_libraries(kcertpart ${KDE4_KPARTS_LIBS})
install(
TARGETS kcertpart
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
)
install(
FILES kcertpart.desktop
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
)
install(
FILES kcertpart.rc
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kcertpart
)

View file

@ -1,3 +0,0 @@
#! /usr/bin/env bash
$EXTRACTRC *.rc >> rc.cpp
$XGETTEXT *.cpp -o $podir/kcertpart.pot

View file

@ -1,890 +0,0 @@
/* This file is part of the KDE project
*
* Copyright (C) 2001-2003 George Staikos <staikos@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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.
*/
#include "kcertpart.h"
#include <kpluginfactory.h>
#include <kpluginloader.h>
#include <kcomponentdata.h>
#include <kaboutdata.h>
#include <QtGui/QFrame>
#include <klocale.h>
#include <kdebug.h>
#include <QtGui/QLabel>
#include <QtGui/QLayout>
#include <QtGui/QPushButton>
#include <QtGui/QComboBox>
#include <kmessagebox.h>
#include <kpassworddialog.h>
#include <ksslall.h>
#include <kopenssl.h>
#include <ksslcertificatebox.h>
#include <ksslpemcallback.h>
#include <kfiledialog.h>
#include <QtCore/QProcess>
#include <kseparator.h>
#include <QtGui/QTreeWidget>
#include <QtCore/QRegExp>
#include <kcombobox.h>
#include <kparts/browserextension.h>
#include <kparts/browserinterface.h>
#include <kmimetype.h>
#include <ktabwidget.h>
#include <ktextedit.h>
K_PLUGIN_FACTORY( KCertPartFactory, registerPlugin<KCertPart>(); )
K_EXPORT_PLUGIN( KCertPartFactory("KCertPart") )
KX509Item::KX509Item(QTreeWidgetItem *parent, KSSLCertificate *x) :
QTreeWidgetItem(parent, 1001)
{
setup(x);
}
KX509Item::KX509Item(QTreeWidget *parent, KSSLCertificate *x) :
QTreeWidgetItem(parent)
{
setup(x);
}
void KX509Item::setup(KSSLCertificate *x) {
cert = x;
if (x) {
KSSLX509Map xm(x->getSubject());
QString OU = "OU";
QString CN = "CN";
OU = xm.getValue(OU);
CN = xm.getValue(CN);
OU.remove(QRegExp("\n.*"));
CN.remove(QRegExp("\n.*"));
if (OU.length() > 0) {
_prettyName = OU;
}
if (CN.length() > 0) {
if (_prettyName.length() > 0) {
_prettyName += " - ";
}
_prettyName += CN;
}
setText(0, _prettyName);
} else {
setText(0, i18n("Invalid certificate"));
}
}
KX509Item::~KX509Item()
{
delete cert;
}
KPKCS12Item::KPKCS12Item(QTreeWidgetItem *parent, KSSLPKCS12 *x) :
QTreeWidgetItem(parent)
{
cert = x;
if (x) {
KSSLX509Map xm(x->getCertificate()->getSubject());
QString CN = "CN";
CN = xm.getValue(CN);
CN.remove(QRegExp("\n.*"));
_prettyName = CN;
setText(0, _prettyName);
} else {
setText(0, i18n("Invalid certificate"));
}
}
KPKCS12Item::~KPKCS12Item()
{
delete cert;
}
class KCertPartPrivate {
public:
KParts::BrowserExtension *browserExtension;
};
KCertPart::KCertPart(QWidget *parentWidget,
QObject *parent,
const QVariantList & /*args*/ )
: KParts::ReadWritePart(parent),
d(new KCertPartPrivate)
{
setComponentData(KCertPartFactory::componentData());
QGridLayout *grid;
_signers = new KSSLSigners;
// This is a bit confusing now. Here's how it works:
// We create a _frame and split it left/right
// Then we add the ListView to the left and create
// a new frame on the right. We set the main widget
// on the right.
_p12 = NULL;
_ca = NULL;
_silentImport = false;
d->browserExtension = new KParts::BrowserExtension(this);
_frame = new QFrame(parentWidget);
setWidget(_frame);
_baseGrid = new QGridLayout(_frame);
_baseGrid->setMargin(KDialog::marginHint());
_baseGrid->setSpacing(KDialog::spacingHint());
_sideList = new QTreeWidget(_frame);
_sideList->setRootIsDecorated(true);
_sideList->setHeaderLabels(QStringList() << i18n("Certificates"));
_parentCA = new QTreeWidgetItem(_sideList, QStringList() << i18n("Signers"));
_parentCA->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
_parentCA->setExpanded(true);
_parentP12 = new QTreeWidgetItem(_sideList, QStringList() << i18n("Client"));
_parentP12->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
_parentP12->setExpanded(true);
_baseGrid->addWidget(_sideList, 0, 0, 14, 2);
_importAll = new QPushButton(i18n("Import &All"), _frame);
_baseGrid->addWidget(_importAll, 14, 0, 1, 2);
connect(_importAll, SIGNAL(clicked()), SLOT(slotImportAll()));
//------------------------------------------------------------------------
// The PKCS widget
//------------------------------------------------------------------------
_pkcsFrame = new QFrame(_frame);
grid = new QGridLayout(_pkcsFrame);
grid->setMargin(KDialog::marginHint());
grid->setSpacing(KDialog::spacingHint());
grid->addWidget(new QLabel(i18n("KDE Secure Certificate Import"), _pkcsFrame), 0, 0, 1, 6);
grid->addWidget(new QLabel(i18n("Chain:"), _pkcsFrame), 1, 0);
_p12_chain = new KComboBox(_pkcsFrame);
grid->addWidget(_p12_chain, 1, 1, 1, 4);
connect(_p12_chain, SIGNAL(activated(int)), SLOT(slotChain(int)));
grid->addWidget(new QLabel(i18n("Subject:"), _pkcsFrame), 2, 0);
grid->addWidget(new QLabel(i18n("Issued by:"), _pkcsFrame), 2, 3);
_p12_subject = new KSslCertificateBox(_pkcsFrame);
_p12_issuer = new KSslCertificateBox(_pkcsFrame);
grid->addWidget(_p12_subject, 3, 0, 4, 3);
grid->addWidget(_p12_issuer, 3, 3, 4, 3);
grid->addWidget(new QLabel(i18n("File:"), _pkcsFrame), 7, 0);
_p12_filenameLabel = new QLabel("", _pkcsFrame);
grid->addWidget(_p12_filenameLabel, 7, 1);
grid->addWidget(new QLabel(i18n("File format:"), _pkcsFrame), 7, 3);
grid->addWidget(new QLabel("PKCS#12", _pkcsFrame), 7, 4);
//
// Make the first tab
//
_tabs = new KTabWidget(_pkcsFrame);
grid->addWidget(_tabs, 8, 0, 5, 6);
QFrame *tab = new QFrame(_pkcsFrame);
QGridLayout *tabGrid = new QGridLayout(tab);
tabGrid->setMargin(KDialog::marginHint());
tabGrid->setSpacing(KDialog::spacingHint());
tabGrid->addWidget(new QLabel(i18nc("State of the certification", "State:"), tab), 0, 0);
_p12_certState = new QLabel("", tab);
tabGrid->addWidget(_p12_certState, 0, 1, 1, 4);
tabGrid->addWidget(new QLabel(i18n("Valid from:"), tab), 1, 0);
_p12_validFrom = new QLabel("", tab);
tabGrid->addWidget(_p12_validFrom, 1, 1, 1, 4);
tabGrid->addWidget(new QLabel(i18n("Valid until:"), tab), 2, 0);
_p12_validUntil = new QLabel("", tab);
tabGrid->addWidget(_p12_validUntil, 2, 1, 1, 4);
tabGrid->addWidget(new QLabel(i18n("Serial number:"), tab), 3, 0);
_p12_serialNum = new QLabel("", tab);
tabGrid->addWidget(_p12_serialNum, 3, 1);
_tabs->addTab(tab, i18nc("State of the certification", "State"));
//
// Make the second tab
//
tab = new QFrame(_pkcsFrame);
tabGrid = new QGridLayout(tab);
tabGrid->setMargin(KDialog::marginHint());
tabGrid->setSpacing(KDialog::spacingHint());
tabGrid->addWidget(new QLabel(i18n("MD5 digest:"), tab), 0, 0);
_p12_digest = new QLabel(tab);
tabGrid->addWidget(_p12_digest, 0, 1, 1, 4);
tabGrid->addWidget(new QLabel(i18n("Signature:"), tab), 1, 0);
_p12_sig = new KTextEdit(tab);
tabGrid->addWidget(_p12_sig, 1, 1, 3, 4);
_p12_sig->setReadOnly(true);
_tabs->addTab(tab, i18n("Signature"));
//
// Make the third tab
//
tab = new QFrame(_pkcsFrame);
tabGrid = new QGridLayout(tab);
tabGrid->setMargin(KDialog::marginHint());
tabGrid->setSpacing(KDialog::spacingHint());
tabGrid->addWidget(new QLabel(i18n("Public key:"), tab), 0, 0);
_p12_pubkey = new KTextEdit(tab);
tabGrid->addWidget(_p12_pubkey, 0, 1, 4, 4);
_p12_pubkey->setReadOnly(true);
_tabs->addTab(tab, i18n("Public Key"));
_pkcsFrame->hide();
//------------------------------------------------------------------------
// The X509 widget
//------------------------------------------------------------------------
// Note: this is almost identical to the above, but I duplicate it for
// the simple reason that the above has potential to display much
// more information, and this one has potential to display different
// information.
_x509Frame = new QFrame(_frame);
grid = new QGridLayout(_x509Frame);
grid->setMargin(KDialog::marginHint());
grid->setSpacing(KDialog::spacingHint());
grid->addWidget(new QLabel(i18n("KDE Secure Certificate Import"), _x509Frame), 0, 0, 1, 6);
grid->addWidget(new QLabel(i18n("Subject:"), _x509Frame), 1, 0);
grid->addWidget(new QLabel(i18n("Issued by:"), _x509Frame), 1, 3);
_ca_subject = new KSslCertificateBox(_x509Frame);
_ca_issuer = new KSslCertificateBox(_x509Frame);
grid->addWidget(_ca_subject, 2, 0, 4, 3);
grid->addWidget(_ca_issuer, 2, 3, 4, 3);
grid->addWidget(new QLabel(i18n("File:"), _x509Frame), 6, 0);
_ca_filenameLabel = new QLabel("", _x509Frame);
grid->addWidget(_ca_filenameLabel, 6, 1);
grid->addWidget(new QLabel(i18n("File format:"), _x509Frame), 6, 3);
grid->addWidget(new QLabel(i18n("PEM or DER Encoded X.509"), _x509Frame), 6, 4);
//
// Make the first tab
//
_tabs = new KTabWidget(_x509Frame);
grid->addWidget(_tabs, 7, 0, 5, 6);
tab = new QFrame(_x509Frame);
tabGrid = new QGridLayout(tab);
tabGrid->setMargin(KDialog::marginHint());
tabGrid->setSpacing(KDialog::spacingHint());
tabGrid->addWidget(new QLabel(i18nc("State of the certification", "State:"), tab), 0, 0);
_ca_certState = new QLabel("", tab);
tabGrid->addWidget(_ca_certState, 0, 1, 1, 4);
tabGrid->addWidget(new QLabel(i18n("Valid from:"), tab), 1, 0);
_ca_validFrom = new QLabel("", tab);
tabGrid->addWidget(_ca_validFrom, 1, 1, 1, 4);
tabGrid->addWidget(new QLabel(i18n("Valid until:"), tab), 2, 0);
_ca_validUntil = new QLabel("", tab);
tabGrid->addWidget(_ca_validUntil, 2, 1, 1, 4);
tabGrid->addWidget(new QLabel(i18n("Serial number:"), tab), 3, 0);
_ca_serialNum = new QLabel("", tab);
tabGrid->addWidget(_ca_serialNum, 3, 1);
_tabs->addTab(tab, i18nc("State of the certification", "State"));
//
// Make the second tab
//
tab = new QFrame(_x509Frame);
tabGrid = new QGridLayout(tab);
tabGrid->setMargin(KDialog::marginHint());
tabGrid->setSpacing(KDialog::spacingHint());
tabGrid->addWidget(new QLabel(i18n("MD5 digest:"), tab), 0, 0);
_ca_digest = new QLabel(tab);
tabGrid->addWidget(_ca_digest, 0, 1, 1, 4);
tabGrid->addWidget(new QLabel(i18n("Signature:"), tab), 1, 0);
_ca_sig = new KTextEdit(tab);
tabGrid->addWidget(_ca_sig, 1, 1, 3, 4);
_ca_sig->setReadOnly(true);
_tabs->addTab(tab, i18n("Signature"));
//
// Make the third tab
//
tab = new QFrame(_x509Frame);
tabGrid = new QGridLayout(tab);
tabGrid->setMargin(KDialog::marginHint());
tabGrid->setSpacing(KDialog::spacingHint());
tabGrid->addWidget(new QLabel(i18n("Public key:"), tab), 0, 0);
_ca_pubkey = new KTextEdit(tab);
tabGrid->addWidget(_ca_pubkey, 0, 1, 4, 4);
_ca_pubkey->setReadOnly(true);
_tabs->addTab(tab, i18n("Public Key"));
_x509Frame->hide();
//------------------------------------------------------------------------
// The blank widget
//------------------------------------------------------------------------
_blankFrame = new QFrame(_frame);
grid = new QGridLayout(_blankFrame);
grid->setMargin(KDialog::marginHint());
grid->setSpacing(KDialog::spacingHint());
grid->addWidget(new QLabel(i18n("KDE Secure Certificate Import"), _blankFrame), 0, 0, 1, 1);
_blankFrame->show();
//
// Finish it off
//
_baseGrid->addWidget(new KSeparator(_frame), 13, 2, 1, 7);
_launch = new QPushButton(i18n("&Crypto Manager..."), _frame);
_import = new QPushButton(i18n("&Import"), _frame);
_save = new QPushButton(i18n("&Save..."), _frame);
_done = new QPushButton(i18n("&Done"), _frame);
_baseGrid->addWidget(_launch, 14, 4, 1, 2);
_baseGrid->addWidget(_import, 14, 6);
_baseGrid->addWidget(_save, 14, 7);
_baseGrid->addWidget(_done, 14, 8);
connect(_launch, SIGNAL(clicked()), SLOT(slotLaunch()));
connect(_import, SIGNAL(clicked()), SLOT(slotImport()));
connect(_save, SIGNAL(clicked()), SLOT(slotSave()));
connect(_done, SIGNAL(clicked()), SLOT(slotDone()));
_import->setEnabled(false);
_save->setEnabled(false);
_baseGrid->addWidget(_pkcsFrame, 0, 2, 13, 7);
_baseGrid->addWidget(_x509Frame, 0, 2, 13, 7);
_baseGrid->addWidget(_blankFrame, 0, 2, 13, 7);
connect(_sideList, SIGNAL(itemSelectionChanged()),
this, SLOT(slotSelectionChanged()));
setReadWrite(true);
}
KCertPart::~KCertPart() {
delete _signers;
delete d->browserExtension;
delete d;
}
void KCertPart::setReadWrite(bool rw) {
if (!rw) {
_import->setEnabled(false);
_save->setEnabled(false);
}
KParts::ReadWritePart::setReadWrite(rw);
}
bool KCertPart::saveFile() {
if (_p12) {
QString certFile = KFileDialog::getSaveFileName(QString(), "application/x-pkcs12");
if (certFile.isEmpty())
return false;
if (!_p12->toFile(certFile)) {
KMessageBox::sorry(_frame, i18n("Save failed."), i18n("Certificate Import"));
return false;
}
return true;
} else if (_ca) {
QString certFile = KFileDialog::getSaveFileName(QString(), "application/x-x509-ca-cert");
if (certFile.isEmpty())
return false;
QByteArray enc;
if (certFile.endsWith(QLatin1String("der")) || certFile.endsWith(QLatin1String("crt"))) {
enc = _ca->toDer();
} else if (certFile.endsWith(QLatin1String("netscape"))) {
enc = _ca->toNetscape();
} else {
enc = _ca->toPem();
}
QFile of(certFile);
if (!of.open(QIODevice::WriteOnly) || of.write(enc) != enc.size()) {
KMessageBox::sorry(_frame, i18n("Save failed."), i18n("Certificate Import"));
return false;
}
of.flush();
return true;
} else {
return false;
}
}
bool KCertPart::openFile() {
#ifndef KSSL_HAVE_SSL
KMessageBox::sorry(_frame, i18n("You do not seem to have compiled KDE with SSL support."), i18n("Certificate Import"));
return false;
#else
if (QFileInfo(localFilePath()).size() == 0) {
KMessageBox::sorry(_frame, i18n("Certificate file is empty."), i18n("Certificate Import"));
return false;
}
QString whatType = arguments().mimeType();
//whatType = KMimeType::findByURL(m_url,0,true)->name();
if (whatType.isEmpty())
whatType = KMimeType::findByPath(localFilePath(), 0, true)->name();
/*
QString blah = "file: " + m_file
+ "\nurl: " + m_url.url()
+ "\nserviceType: " + d->browserExtension->urlArgs().serviceType
+ "\nfactory: " + KServiceTypeFactory::self()->findFromPattern(m_file)->name()
+ "\nmimeType: " + KMimeType::findByURL(m_url)->name();
KMessageBox::information(_frame, blah, "ssl");
*/
emit completed();
/////////////////////////////////////////////////////////////////////////////
// x-pkcs12 loading
/////////////////////////////////////////////////////////////////////////////
if (whatType == "application/x-pkcs12") {
_p12 = KSSLPKCS12::loadCertFile(localFilePath());
while (!_p12) {
// try prompting for a password.
KPasswordDialog dlg(_frame);
dlg.setCaption(i18n("Certificate Password"));
dlg.setPrompt(i18n("Certificate Password"));
if( !dlg.exec() )
break;
_p12 = KSSLPKCS12::loadCertFile(localFilePath(), dlg.password());
if (!_p12) {
int rc = KMessageBox::warningContinueCancel(_frame, i18n("The certificate file could not be loaded. Try a different password?"), i18n("Certificate Import"),KGuiItem(i18n("Try Different")));
if (rc == KMessageBox::Continue) continue;
break;
}
}
if (!_p12) return false;
new KPKCS12Item(_parentP12, _p12);
_p12 = NULL;
return true;
/////////////////////////////////////////////////////////////////////////////
// x-509-ca-cert loading
/////////////////////////////////////////////////////////////////////////////
} else if (whatType == "application/x-x509-ca-cert" ||
whatType == "application/binary-certificate") { // DF: this mimetype does not exist
FILE *fp;
bool isPEM = false;
_ca_filenameLabel->setText(localFilePath());
///////////// UGLY HACK TO GET AROUND OPENSSL PROBLEMS ///////////
if (whatType == "application/x-x509-ca-cert") {
// Check if it is PEM or not
QFile qf(localFilePath());
qf.open(QIODevice::ReadOnly);
QByteArray theFile = qf.readAll();
qf.close();
const char *signature = "-----BEGIN CERTIFICATE-----";
isPEM = theFile.contains(signature);
}
fp = fopen(localFilePath().toLocal8Bit(), "r");
if (!fp) {
KMessageBox::sorry(_frame, i18n("This file cannot be opened."), i18n("Certificate Import"));
return false;
}
/*
kDebug() << "Reading in a file in "
<< (isPEM ? "PEM" : "DER")
<< " format." << endl;
*/
if (!isPEM) {
X509 *dx = KOSSL::self()->X509_d2i_fp(fp, NULL);
if (dx) {
KSSLCertificate *xc = KSSLCertificate::fromX509(dx);
if (xc) {
if (xc->x509V3Extensions().certTypeCA())
new KX509Item(_parentCA, xc);
else
new KX509Item(_sideList, xc);
fclose(fp);
return true;
}
KOSSL::self()->X509_free(dx);
}
return false;
}
#define sk_free KOSSL::self()->sk_free
#define sk_num KOSSL::self()->sk_num
#define sk_value KOSSL::self()->sk_value
STACK_OF(X509_INFO) *sx5i = KOSSL::self()->PEM_X509_INFO_read(fp, NULL, KSSLPemCallback, NULL);
if (!sx5i) {
KMessageBox::sorry(_frame, i18n("This file cannot be opened."), i18n("Certificate Import"));
fclose(fp);
return false;
}
_ca_filenameLabel->setText(localFilePath());
for (int i = 0; i < sk_X509_INFO_num(sx5i); i++) {
X509_INFO* x5i = sk_X509_INFO_value(sx5i, i);
if (x5i->x_pkey && x5i->x509) { // a personal cert (like PKCS12)
KSSLCertificate *xc = KSSLCertificate::fromX509(x5i->x509);
new KX509Item(_sideList, xc);
} else if (x5i->x509) { // something else - maybe a CA file
KSSLCertificate *xc = KSSLCertificate::fromX509(x5i->x509);
if (xc->x509V3Extensions().certTypeCA())
new KX509Item(_parentCA, xc);
else new KX509Item(_sideList, xc);
} else if (x5i->crl) { // a crl
kDebug() << "Found a CRL...";
}
}
sk_X509_INFO_free(sx5i);
#undef sk_free
#undef sk_num
#undef sk_value
fclose(fp);
return true;
/////////////////////////////////////////////////////////////////////////////
// Dunno how to load this
/////////////////////////////////////////////////////////////////////////////
} else {
QString emsg = i18n("I do not know how to handle this type of file.") + '\n' + whatType;
KMessageBox::sorry(_frame, emsg, i18n("Certificate Import"));
return false;
}
#endif
}
void KCertPart::displayPKCS12() {
KSSLCertificate *xc = _p12->getCertificate();
_p12_filenameLabel->setText(localFilePath());
displayPKCS12Cert(xc);
_p12_certState->setText(KSSLCertificate::verifyText(_p12->validate()));
// Set the chain if it's there
if (xc->chain().depth() > 1) {
const QList<KSSLCertificate *> cl = xc->chain().getChain();
int cnt = 0;
_p12_chain->setEnabled(true);
_p12_chain->clear();
_p12_chain->addItem(i18n("0 - Site Certificate"));
foreach (KSSLCertificate *c, cl) {
KSSLX509Map map(c->getSubject());
_p12_chain->addItem(QString::number(++cnt)+" - "+map.getValue("CN"));
}
qDeleteAll(cl);
_p12_chain->setCurrentIndex(0);
} else {
_p12_chain->clear();
_p12_chain->setEnabled(false);
}
}
void KCertPart::displayCACert(KSSLCertificate *c) {
// We have the file, lets work with it.
//### _ca_subject->setValues(c->getSubject());
//### _ca_issuer->setValues(c->getIssuer());
// Set the valid period
QPalette cspl = _ca_validFrom->palette();
if (QDateTime::currentDateTime() < c->getQDTNotBefore()) {
cspl.setColor(QPalette::Foreground, QColor(196,33,21));
} else {
cspl.setColor(QPalette::Foreground, QColor(42,153,59));
}
_ca_validFrom->setPalette(cspl);
_ca_validFrom->setText(c->getNotBefore());
cspl = _ca_validUntil->palette();
if (QDateTime::currentDateTime() > c->getQDTNotAfter()) {
cspl.setColor(QPalette::Foreground, QColor(196,33,21));
} else {
cspl.setColor(QPalette::Foreground, QColor(42,153,59));
}
_ca_validUntil->setPalette(cspl);
_ca_validUntil->setText(c->getNotAfter());
_ca_serialNum->setText(c->getSerialNumber());
cspl = _ca_certState->palette();
if (!c->isValid()) {
cspl.setColor(QPalette::Foreground, QColor(196,33,21));
} else {
cspl.setColor(QPalette::Foreground, QColor(42,153,59));
}
_ca_certState->setPalette(cspl);
_ca_certState->setText(KSSLCertificate::verifyText(c->validate()));
_ca_pubkey->setPlainText (c->getPublicKeyText());
_ca_digest->setText(c->getMD5DigestText());
_ca_sig->setPlainText(c->getSignatureText());
}
void KCertPart::displayPKCS12Cert(KSSLCertificate *c) {
// We have the file, lets work with it.
//### _p12_subject->setValues(c->getSubject());
//### _p12_issuer->setValues(c->getIssuer());
// Set the valid period
QPalette cspl = _p12_validFrom->palette();
if (QDateTime::currentDateTime() < c->getQDTNotBefore()) {
cspl.setColor(QPalette::Foreground, QColor(196,33,21));
} else {
cspl.setColor(QPalette::Foreground, QColor(42,153,59));
}
_p12_validFrom->setPalette(cspl);
_p12_validFrom->setText(c->getNotBefore());
cspl = _p12_validUntil->palette();
if (QDateTime::currentDateTime() > c->getQDTNotAfter()) {
cspl.setColor(QPalette::Foreground, QColor(196,33,21));
} else {
cspl.setColor(QPalette::Foreground, QColor(42,153,59));
}
_p12_validUntil->setPalette(cspl);
_p12_validUntil->setText(c->getNotAfter());
_p12_serialNum->setText(c->getSerialNumber());
cspl = _p12_certState->palette();
if (!c->isValid()) {
cspl.setColor(QPalette::Foreground, QColor(196,33,21));
} else {
cspl.setColor(QPalette::Foreground, QColor(42,153,59));
}
_p12_certState->setPalette(cspl);
_p12_certState->setText(KSSLCertificate::verifyText(c->validate()));
_p12_pubkey->setPlainText(c->getPublicKeyText());
_p12_digest->setText(c->getMD5DigestText());
_p12_sig->setPlainText(c->getSignatureText());
}
void KCertPart::slotChain(int c) {
if (c == 0) {
displayPKCS12Cert(_p12->getCertificate());
_p12_certState->setText(KSSLCertificate::verifyText(_p12->validate()));
} else {
displayPKCS12Cert(_p12->getCertificate()->chain().getChain().at(c-1));
}
}
void KCertPart::slotImport() {
if (_p12) {
KConfig cfg("ksslcertificates", KConfig::SimpleConfig);
if (cfg.hasGroup(_p12->getCertificate()->getSubject())) {
QString msg = _curName + '\n' + i18n("A certificate with that name already exists. Are you sure that you wish to replace it?");
int rc= KMessageBox::warningContinueCancel(_frame, msg, i18n("Certificate Import"),KGuiItem(i18n("Replace")));
if (rc == KMessageBox::Cancel) {
return;
}
}
KConfigGroup cg(&cfg, _p12->getCertificate()->getSubject());
cg.writeEntry("PKCS12Base64", _p12->toString());
cg.writeEntry("Password", "");
cg.sync();
if (!_silentImport)
KMessageBox::information(_frame, i18n("Certificate has been successfully imported into KDE.\nYou can manage your certificate settings from the KDE System Settings."), i18n("Certificate Import"));
} else if (_ca) {
KConfig cfg("ksslcalist", KConfig::NoGlobals);
if (cfg.hasGroup(_ca->getSubject())) {
QString msg = _curName + '\n' + i18n("A certificate with that name already exists. Are you sure that you wish to replace it?");
int rc= KMessageBox::warningContinueCancel(_frame, msg, i18n("Certificate Import"),KGuiItem(i18n("Replace")));
if (rc == KMessageBox::Cancel) {
return;
}
}
_signers->addCA(_ca->toString(),
_ca->x509V3Extensions().certTypeSSLCA(),
_ca->x509V3Extensions().certTypeEmailCA(),
_ca->x509V3Extensions().certTypeCodeCA());
if (!_silentImport)
_signers->regenerate();
if (!_silentImport)
KMessageBox::information(_frame, i18n("Certificate has been successfully imported into KDE.\nYou can manage your certificate settings from the KDE System Settings."), i18n("Certificate Import"));
}
}
void KCertPart::slotSave() {
saveFile();
}
void KCertPart::slotDone() {
KParts::BrowserInterface *iface = d->browserExtension->browserInterface();
iface->callMethod("goHistory", -1);
}
void KCertPart::slotLaunch() {
QProcess::startDetached("kcmshell4", QStringList() << "crypto");
}
void KCertPart::slotSelectionChanged() {
// we assume that there is only one item selected...
QTreeWidgetItem *x = _sideList->selectedItems().at(0);
KX509Item *x5i = dynamic_cast<KX509Item*>(x);
KPKCS12Item *p12i = dynamic_cast<KPKCS12Item*>(x);
_p12 = NULL;
_ca = NULL;
if (x && x->parent() == _parentCA) {
if (!x5i) {
return;
}
x5i->cert->revalidate();
_blankFrame->hide();
_pkcsFrame->hide();
_x509Frame->show();
_ca = x5i->cert;
_import->setEnabled(true);
_save->setEnabled(true);
_curName = x5i->_prettyName;
displayCACert(_ca);
} else if (x && x->parent() == NULL && x->type() == 1001) {
if (!x5i) {
return;
}
x5i->cert->revalidate();
_blankFrame->hide();
_pkcsFrame->hide();
_x509Frame->show();
_ca = x5i->cert;
_import->setEnabled(false);
_save->setEnabled(false);
_curName = x5i->_prettyName;
displayCACert(_ca);
} else if (x && x->parent() == _parentP12) {
if (!p12i) {
return;
}
p12i->cert->revalidate();
_blankFrame->hide();
_x509Frame->hide();
_pkcsFrame->show();
_p12 = p12i->cert;
_import->setEnabled(true);
_save->setEnabled(true);
_curName = p12i->_prettyName;
displayPKCS12();
} else {
_pkcsFrame->hide();
_x509Frame->hide();
_blankFrame->show();
_import->setEnabled(false);
_save->setEnabled(false);
_curName = "";
}
}
void KCertPart::slotImportAll() {
KSSLPKCS12 *p12Save = _p12;
KSSLCertificate *caSave = _ca;
QString curNameSave = _curName;
_p12 = NULL;
_ca = NULL;
_silentImport = true;
QTreeWidgetItemIterator it(_parentP12);
while (*it) {
dynamic_cast<KPKCS12Item*>(*it)->cert;
dynamic_cast<KPKCS12Item*>(*it)->_prettyName;
slotImport();
it++;
}
_p12 = NULL;
it = QTreeWidgetItemIterator(_parentCA);
while (*it) {
dynamic_cast<KX509Item*>(*it)->cert;
dynamic_cast<KX509Item*>(*it)->_prettyName;
slotImport();
it++;
}
_ca = NULL;
_signers->regenerate();
_silentImport = false;
_p12 = p12Save;
_ca = caSave;
_curName = curNameSave;
KMessageBox::information(_frame, i18n("Certificates have been successfully imported into KDE.\nYou can manage your certificate settings from the KDE System Settings."), i18n("Certificate Import"));
}
KAboutData *KCertPart::createAboutData()
{
return new KAboutData("KCertPart", 0, ki18n("KDE Certificate Part"), "1.0");
}
#include "moc_kcertpart.cpp"

View file

@ -1,198 +0,0 @@
[Desktop Entry]
Type=Service
Comment=Embeddable Personal Certificate Manager
Comment[af]=Inlegbare Persoonlike Sertifikaat Bestuurder
Comment[ar]=مدير شهادات شخصي مدمج
Comment[as]=ি Personal Certificate Manager
Comment[ast]=Xestor de certificaos personales encrustable
Comment[be]=Унутраны кіраўнік асабістых сертыфікатаў
Comment[be@latin]=Unutrany ŭłasny kiraŭnik sertyfikataŭ
Comment[bg]=Мениджър за вградени удостоверения
Comment[bn]= ি িি
Comment[bn_IN]= ি িি ি
Comment[bs]=Ugnezdivi menadžer ličnih sertifikata
Comment[ca]=Gestor incrustable de certificats personals
Comment[ca@valencia]=Gestor incrustable de certificats personals
Comment[cs]=Pohltitelný správce osobních certifikátů
Comment[csb]=Wbùdowóny swój menadżer certifikatów
Comment[cy]=Rheolydd Tystysgrif Bersonol Mewnadeiladadwy
Comment[da]=Indlejrbar personlig certifikathåndtering
Comment[de]=Einbettungsfähige Verwaltung für persönliche Zertifikate
Comment[el]=Ενσωματώσιμος διαχειριστής προσωπικών πιστοποιητικών
Comment[en_GB]=Embeddable Personal Certificate Manager
Comment[eo]=Enkorpigebla administrilo por personaj atestiloj
Comment[es]=Gestor personal de certificados empotrable
Comment[et]=Põimitav personaalsete sertifikaatide haldur
Comment[eu]=Ziurtagiri pertsonalen kudeatzaile kapsulagarria
Comment[fa]=مدیر گواهینامه شخصی نهفته
Comment[fi]=Upotettava henkilökohtaisten varmenteiden hallinta
Comment[fr]=Gestionnaire intégrable de certificats personnels
Comment[fy]=Yn te sluten Persoanlik-sertifikaatbehearder
Comment[ga]=Bainisteoir Teastas Pearsanta Inleabaithe
Comment[gl]=Xestor persoal de certificados integrábel
Comment[gu]=િ
Comment[he]=מנהל תעודות אישי הניתן לשיבוץ
Comment[hi]=िि ि
Comment[hne]= ि
Comment[hr]=Ugradivi upravitelj osobnim potvrdama
Comment[hsb]=Integrujomny Personal Certificate Manager
Comment[hu]=Beágyazható személyes tanúsítványkezelő
Comment[hy]=Ներդրված անձնական վկայականի ղեկավար
Comment[ia]=Administrator de Certificato Personal Incorporabile
Comment[id]=Manajer Sertifikat Personal Dapat Dibenamkan
Comment[is]=Ívefjanlegur einkaskírteina-stjóri
Comment[it]=Gestione integrabile dei certificati personali
Comment[ja]=
Comment[kk]=Ендірілетін дербес куәлік менеджері
Comment[km]=
Comment[kn]=ಿ () ಿ
Comment[ko]=
Comment[ku]=Rêveberê Belge Kirina Şexsî yê Dibe Jixwe Heyî
Comment[lb]=Abettbare perséinlechen Zertifikatsmanager
Comment[lt]=Įdedama asmeninių liudijimų tvarkyklė
Comment[lv]=Iegulstams personīgo sertifikātu pārvaldnieks
Comment[mai]=िि ि
Comment[mk]=Вгнездлив менаџер на лични сертификати
Comment[ml]= ി
Comment[mr]=
Comment[ms]=Pengurus Sijil Peribadi Boleh Serta
Comment[nb]=Innebygget personlig sertifikathåndterer
Comment[nds]=Inbettbor Pleger för persöönlich Zertifikaten
Comment[ne]=िि ि
Comment[nl]=Ingebedde Persoonlijke Certificaat-beheerder
Comment[nn]=Innebyggbar handsamar av personlege sertifikat
Comment[or]=ି ି ି
Comment[pa]=ਿ ਿ
Comment[pl]=Osadzalny osobisty menedżer certyfikatów
Comment[pt]=Gestor de Certificados Pessoais Incorporado
Comment[pt_BR]=Gerenciador pessoal de certificados integrável
Comment[ro]=Componentă manager de certificate personale
Comment[ru]=Управление личными сертификатами
Comment[se]=Vuojuhanláhkái persuvnnalaš duođaštusaid gieđahalli
Comment[si]=
Comment[sk]=Zabudovaný správca osobných certifikátov
Comment[sl]=Vgradljivi osebni upravljalnik potrdil
Comment[sr]=Угнездиви менаџер личних сертификата
Comment[sr@ijekavian]=Угњездиви менаџер личних сертификата
Comment[sr@ijekavianlatin]=Ugnjezdivi menadžer ličnih sertifikata
Comment[sr@latin]=Ugnezdivi menadžer ličnih sertifikata
Comment[sv]=Inbäddningsbar personlig certifikatshanterare
Comment[ta]=ி ி
Comment[te]= ి ి
Comment[tg]=Мудири иҷозатномаҳои дарунсохташудаи шахсӣ
Comment[th]=
Comment[tr]=Gömülebilir Kişisel Sertifika Yöneticisi
Comment[tt]=Шәхси Таныклыклар өчен Кушылмалар Идарәсе
Comment[ug]=سىڭدۈرۈشچان شەخسىي گۇۋاھنامە باشقۇرغۇچ
Comment[uk]=Менеджер персональних сертифікатів, який можна вбудовувати
Comment[uz]=Ichiga oʻrnatib boʻladigan shaxsiy sertifikat boshqaruvchisi
Comment[uz@cyrillic]=Ичига ўрнатиб бўладиган шахсий сертификат бошқарувчиси
Comment[vi]=B Qun lý Chng nhn Cá nhân có kh năng nhúng
Comment[wa]=Ravalé manaedjeu d' acertineures da vosse
Comment[xh]=Umphathi Wesiqinisekiso Sobuntu bakho Obulungiselelweyo
Comment[x-test]=xxEmbeddable Personal Certificate Managerxx
Comment[zh_CN]=
Comment[zh_HK]=
Comment[zh_TW]=
MimeType=application/x-pkcs12;application/x-x509-ca-cert;
Icon=system-lock-screen
Name=KCertPart
Name[af]=Kcertpart
Name[ar]=KCertPart
Name[as]=KCertPart
Name[ast]=KCertPart
Name[be]=KCertPart
Name[be@latin]=KCertPart
Name[bg]=KCertPart
Name[bn]=--
Name[bn_IN]=KCertPart
Name[br]=KCertPart
Name[bs]=Sertifikatski dio
Name[ca]=KCertPart
Name[ca@valencia]=KCertPart
Name[cs]=KCertPart
Name[csb]=KCertPart
Name[cy]=KRhanTyst
Name[da]=KCertPart
Name[de]=KCertPart
Name[el]=KCertPart
Name[en_GB]=KCertPart
Name[eo]=Atestilo-parto
Name[es]=KCertPart
Name[et]=KCertPart
Name[eu]=KCertPart
Name[fa]=KCertPart
Name[fi]=KCertPart
Name[fr]=KCertPart
Name[fy]=KCertPart
Name[ga]=KCertPart
Name[gl]=KCertPart
Name[gu]=KCertPart
Name[he]=KCertPart
Name[hi]=--
Name[hne]=--
Name[hr]=KCertPart
Name[hsb]=KCertPart
Name[hu]=KCertPart
Name[hy]=KCertPart
Name[ia]=KcertPart
Name[id]=KCertPart
Name[is]=KCertPart
Name[it]=KCertPart
Name[ja]=KCertPart
Name[kk]=KCertPart
Name[km]=KCertPart
Name[kn]=
Name[ko]=KCertPart
Name[ku]=KCertPart
Name[lb]=KCertPart
Name[lt]=KCertPart
Name[lv]=KCertPart
Name[mai]=--
Name[mk]=KCertPart
Name[ml]=
Name[mr]=KCertPart
Name[ms]=KCertPart
Name[nb]=KCertPart
Name[nds]=KCertPart
Name[ne]=KCertPart
Name[nl]=KCertPart
Name[nn]=KCertPart
Name[or]=KCertPart
Name[pa]=KCertPart
Name[pl]=KCertPart
Name[ps]=KCertPart
Name[pt]=KCertPart
Name[pt_BR]=KCertPart
Name[ro]=KCertPart
Name[ru]=KCertPart
Name[se]=KCertPart
Name[si]=KCertPart
Name[sk]=KCertPart
Name[sl]=KCertPart
Name[sq]=KCertPart
Name[sr]=Сертификатски део
Name[sr@ijekavian]=Сертификатски део
Name[sr@ijekavianlatin]=Sertifikatski deo
Name[sr@latin]=Sertifikatski deo
Name[sv]=Kcertpart
Name[ta]=KCertPart
Name[te]=
Name[tg]=KCertPart
Name[th]=KCertPart
Name[tr]=KCertPart
Name[tt]=KCertPart
Name[ug]=KCertPart
Name[uk]=KCertPart
Name[uz]=KCertPart
Name[uz@cyrillic]=KCertPart
Name[vi]=KCertPart
Name[wa]=KCertPart
Name[xh]=KCertPart
Name[x-test]=xxKCertPartxx
Name[zh_CN]=KCertPart
Name[zh_HK]=KCertPart
Name[zh_TW]=KCertPart
X-KDE-ServiceTypes=KParts/ReadWritePart
X-KDE-Library=kcertpart
InitialPreference=15

View file

@ -1,136 +0,0 @@
/* This file is part of the KDE project
*
* Copyright (C) 2001 George Staikos <staikos@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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.
*/
#ifndef INCLUDE_KCERTPART_H
#define INCLUDE_KCERTPART_H
#include <config.h>
#include <kparts/part.h>
#include <QTreeWidget>
#include <QVariant>
#include <QFrame>
#include <QLabel>
#include <QGridLayout>
#include <QPushButton>
class KSslCertificateBox;
class KCertPartPrivate;
class KComboBox;
class KSSLSigners;
class KSSLPKCS12;
class KSSLCertificate;
class KTabWidget;
class KTextEdit;
class KAboutData;
class KX509Item : public QTreeWidgetItem {
public:
KX509Item(QTreeWidgetItem *parent, KSSLCertificate *x);
KX509Item(QTreeWidget *parent, KSSLCertificate *x);
void setup(KSSLCertificate *x);
~KX509Item();
KSSLCertificate *cert;
QString _prettyName;
};
class KPKCS12Item : public QTreeWidgetItem {
public:
KPKCS12Item(QTreeWidgetItem *parent, KSSLPKCS12 *x);
~KPKCS12Item();
KSSLPKCS12 *cert;
QString _prettyName;
};
class KCertPart : public KParts::ReadWritePart {
Q_OBJECT
public:
explicit KCertPart(QWidget *parentWidget,
QObject *parent = 0L,
const QVariantList &args = QVariantList() );
virtual ~KCertPart();
virtual void setReadWrite(bool rw);
static KAboutData *createAboutData();
protected Q_SLOTS:
void slotChain(int c);
void slotImport();
void slotSave();
void slotDone();
void slotLaunch();
void slotSelectionChanged();
void slotImportAll();
protected:
virtual bool openFile();
virtual bool saveFile();
void displayPKCS12Cert(KSSLCertificate *c);
void displayCACert(KSSLCertificate *c);
QTreeWidget *_sideList;
QTreeWidgetItem *_parentCA, *_parentP12;
QFrame *_pkcsFrame, *_blankFrame, *_x509Frame, *_frame;
// for the PKCS12 widget
QLabel *_p12_filenameLabel, *_p12_validFrom, *_p12_validUntil,
*_p12_serialNum, *_p12_certState;
QLabel *_p12_digest;
KComboBox *_p12_chain;
KTextEdit*_p12_pubkey, *_p12_sig;
KSslCertificateBox *_p12_subject, *_p12_issuer;
// for the CA widget
QLabel *_ca_filenameLabel, *_ca_validFrom, *_ca_validUntil,
*_ca_serialNum, *_ca_certState;
QLabel *_ca_digest;
KTextEdit *_ca_pubkey, *_ca_sig;
KSslCertificateBox *_ca_subject, *_ca_issuer;
// The rest
QPushButton *_import, *_save, *_done, *_launch, *_importAll;
// Store the pointer to the current item
KSSLPKCS12 *_p12;
KSSLCertificate *_ca;
KTabWidget *_tabs;
QGridLayout *_baseGrid;
KSSLSigners *_signers;
bool _silentImport;
QString _curName;
private:
KCertPartPrivate* const d;
void displayPKCS12();
};
#endif

View file

@ -1,10 +0,0 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="KCertPart" version="2">
<MenuBar>
<Menu name="Certificate"><Text>&amp;Certificate</Text>
<Action name="Import"/>
</Menu>
</MenuBar>
<StatusBar/>
</kpartgui>