mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-28 02:24:18 -04:00
added code to generate 3072 and 4096 bit PGP keys at startup (Patch from Serhaf)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7841 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7bc98f1cd5
commit
8cb3ae6d2e
9 changed files with 75 additions and 37 deletions
|
@ -147,6 +147,11 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
|
|||
|
||||
ui.entropy_bar->setValue(0) ;
|
||||
|
||||
// make sure that QVariant always takes an 'int' otherwise the program will crash!
|
||||
ui.keylength_comboBox->addItem("2048 bits", QVariant(2048));
|
||||
ui.keylength_comboBox->addItem("3072 bits", QVariant(3072));
|
||||
ui.keylength_comboBox->addItem("4096 bits", QVariant(4096));
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
ui.email_input->setPlaceholderText(tr("[Optional] Visible to your friends, and friends of friends.")) ;
|
||||
ui.node_input->setPlaceholderText(tr("[Required] Examples: Home, Laptop,...")) ;
|
||||
|
@ -259,6 +264,8 @@ void GenCertDialog::newGPGKeyGenUiSetup() {
|
|||
ui.genButton->setVisible(true);
|
||||
ui.genprofileinfo_label->hide();
|
||||
ui.header_label->show();
|
||||
ui.keylength_label->show();
|
||||
ui.keylength_comboBox->show();
|
||||
} else {
|
||||
genNewGPGKey = false;
|
||||
ui.name_label->hide();
|
||||
|
@ -280,10 +287,11 @@ void GenCertDialog::newGPGKeyGenUiSetup() {
|
|||
ui.headerFrame->setHeaderText(tr("Create a new node"));
|
||||
ui.genprofileinfo_label->show();
|
||||
ui.header_label->hide();
|
||||
ui.keylength_label->hide();
|
||||
ui.keylength_comboBox->hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GenCertDialog::hiddenUiSetup()
|
||||
{
|
||||
|
||||
|
@ -432,6 +440,8 @@ void GenCertDialog::genPerson()
|
|||
ui.importIdentity_PB->hide();
|
||||
ui.genprofileinfo_label->hide();
|
||||
ui.hidden_checkbox->hide();
|
||||
ui.keylength_label->hide();
|
||||
ui.keylength_comboBox->hide();
|
||||
|
||||
setCursor(Qt::WaitCursor) ;
|
||||
|
||||
|
@ -439,7 +449,13 @@ void GenCertDialog::genPerson()
|
|||
while(QAbstractEventDispatcher::instance()->processEvents(QEventLoop::AllEvents)) ;
|
||||
|
||||
std::string email_str = "" ;
|
||||
RsAccounts::GeneratePGPCertificate(ui.name_input->text().toUtf8().constData(), email_str.c_str(), ui.password_input->text().toUtf8().constData(), PGPId, err_string);
|
||||
RsAccounts::GeneratePGPCertificate(
|
||||
ui.name_input->text().toUtf8().constData(),
|
||||
email_str.c_str(),
|
||||
ui.password_input->text().toUtf8().constData(),
|
||||
PGPId,
|
||||
ui.keylength_comboBox->itemData(ui.keylength_comboBox->currentIndex()).toInt(),
|
||||
err_string);
|
||||
|
||||
setCursor(Qt::ArrowCursor) ;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>784</width>
|
||||
<width>805</width>
|
||||
<height>509</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -18,7 +18,16 @@
|
|||
<normaloff>:/images/logo/logo_16.png</normaloff>:/images/logo/logo_16.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
|
@ -247,6 +256,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="keylength_label">
|
||||
<property name="text">
|
||||
<string>RSA key length</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -353,10 +369,30 @@ anonymous, you can use a fake email.</string>
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="keylength_comboBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QProgressBar" name="entropy_bar">
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="entropy_label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="justify">Before proceeding, move your mouse around to help Retroshare collect as much randomness as possible. Filling the progressbar to 20% is needed, 100% is advised.</p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_hiddenaddr2">
|
||||
<property name="minimumSize">
|
||||
|
@ -379,23 +415,6 @@ anonymous, you can use a fake email.</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="entropy_label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="justify">Before proceeding, move your mouse around to help Retroshare collect as much randomness as possible. Filling the progressbar to 20% is needed, 100% is advised.</p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QProgressBar" name="entropy_bar">
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QPushButton" name="genButton">
|
||||
<property name="maximumSize">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue