aboutsummaryrefslogtreecommitdiffstats
path: root/keygendialog.cpp
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-03-24 01:17:38 +0100
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-03-24 01:17:38 +0100
commit7b9608daaace01f317b1b2a5f7ba0be2086d0e0c (patch)
tree0889ad0d919e4d17ff10d15cbe7bc49ad6940b09 /keygendialog.cpp
parentsplit up about dialog to keep translator info independend (diff)
downloadgpg4usb-7b9608daaace01f317b1b2a5f7ba0be2086d0e0c.tar.gz
gpg4usb-7b9608daaace01f317b1b2a5f7ba0be2086d0e0c.zip
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
Diffstat (limited to 'keygendialog.cpp')
-rw-r--r--keygendialog.cpp18
1 files changed, 16 insertions, 2 deletions
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;