From 7b9608daaace01f317b1b2a5f7ba0be2086d0e0c Mon Sep 17 00:00:00 2001 From: nils Date: Sat, 24 Mar 2012 00:17:38 +0000 Subject: on keygen set minimum keysize to 1024 and maximum to 4096 for RSA key and 65536 for DSA/ELgamal key git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@862 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- keygendialog.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'keygendialog.cpp') diff --git a/keygendialog.cpp b/keygendialog.cpp index 532afe7..67c986f 100644 --- a/keygendialog.cpp +++ b/keygendialog.cpp @@ -41,10 +41,10 @@ void KeyGenDialog::generateKeyDialog() commentEdit = new QLineEdit(this); keySizeSpinBox = new QSpinBox(this); - keySizeSpinBox->setRange(768, 65536); + keySizeSpinBox->setRange(1024, 65536); keySizeSpinBox->setValue(2048); - keySizeSpinBox->setSingleStep(256); + keySizeSpinBox->setSingleStep(1024); keyTypeComboBox = new QComboBox(this); keyTypeComboBox->addItem("DSA/Elgamal"); @@ -109,6 +109,7 @@ void KeyGenDialog::generateKeyDialog() connect(expireCheckBox, SIGNAL(stateChanged(int)), this, SLOT(expireBoxChanged())); connect(passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(passwordEditChanged())); + connect(keyTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(keyTypeChanged())); this->setLayout(vbox2); } @@ -219,6 +220,19 @@ void KeyGenDialog::passwordEditChanged() update(); } +void KeyGenDialog::keyTypeChanged() +{ + qDebug() << "changed"; + if (keyTypeComboBox->currentText() == "RSA") { + qDebug() << "RSA"; + keySizeSpinBox->setMaximum(4096); + } else { + qDebug() << "DSA"; + keySizeSpinBox->setMaximum(65536); + } + +} + int KeyGenDialog::checkPassWordStrength() { int strength = 0; -- cgit