mirror of
https://github.com/chris2511/xca.git
synced 2026-09-12 19:51:05 +05:00
apply partial template-contents
- applying the subject only or the extensions only is possible via different buttons. This way a name-template can be created and combined with an extension-only-template like HTTPS_client.
This commit is contained in:
parent
2b38e53cc3
commit
6f5e1da5b6
104
ui/NewX509.ui
104
ui/NewX509.ui
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>598</width>
|
||||
<width>712</width>
|
||||
<height>613</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -83,13 +83,7 @@
|
||||
<attribute name="title">
|
||||
<string>Source</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
@ -326,22 +320,9 @@ If this list is disabled, you only can create a self-signed certificate.</string
|
||||
<item>
|
||||
<widget class="QGroupBox" name="templBox">
|
||||
<property name="title">
|
||||
<string>Template</string>
|
||||
<string>Template for the new certificate</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabel2_3_2">
|
||||
<property name="text">
|
||||
<string>Template for the new certificate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QComboBox" name="tempList">
|
||||
<property name="sizePolicy">
|
||||
@ -359,11 +340,48 @@ If this list is disabled, you only can create a self-signed certificate.</string
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="applyTemplate">
|
||||
<property name="text">
|
||||
<string>Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>13</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="applyExtensions">
|
||||
<property name="text">
|
||||
<string>Apply extensions</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="applySubject">
|
||||
<property name="text">
|
||||
<string>Apply subject</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="applyTemplate">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Apply all</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@ -1659,7 +1677,7 @@ email:my@other.address, RID:1.2.3.4, DNS: ns.server.tld</string>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>587</x>
|
||||
<x>701</x>
|
||||
<y>599</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
@ -1675,12 +1693,12 @@ email:my@other.address, RID:1.2.3.4, DNS: ns.server.tld</string>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>291</x>
|
||||
<y>324</y>
|
||||
<x>308</x>
|
||||
<y>311</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>565</x>
|
||||
<y>326</y>
|
||||
<x>679</x>
|
||||
<y>313</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@ -1711,8 +1729,24 @@ email:my@other.address, RID:1.2.3.4, DNS: ns.server.tld</string>
|
||||
<y>342</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>323</x>
|
||||
<y>342</y>
|
||||
<x>673</x>
|
||||
<y>345</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fromReqCB</sender>
|
||||
<signal>clicked(bool)</signal>
|
||||
<receiver>reqList</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>292</x>
|
||||
<y>147</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>402</x>
|
||||
<y>147</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
|
||||
@ -300,9 +300,16 @@ static QString lb2QString(QListWidget *lb)
|
||||
return sl.join(", ");
|
||||
}
|
||||
|
||||
void NewX509::fromTemplate(pki_temp *temp)
|
||||
void NewX509::subjectFromTemplate(pki_temp *temp)
|
||||
{
|
||||
setX509name(temp->xname);
|
||||
if (temp)
|
||||
setX509name(temp->xname);
|
||||
}
|
||||
|
||||
void NewX509::extensionsFromTemplate(pki_temp *temp)
|
||||
{
|
||||
if (!temp)
|
||||
return;
|
||||
subAltName->setText(temp->subAltName);
|
||||
issAltName->setText(temp->issAltName);
|
||||
crlDist->setText(temp->crlDist);
|
||||
@ -333,6 +340,12 @@ void NewX509::fromTemplate(pki_temp *temp)
|
||||
on_applyTime_clicked();
|
||||
}
|
||||
|
||||
void NewX509::fromTemplate(pki_temp *temp)
|
||||
{
|
||||
subjectFromTemplate(temp);
|
||||
extensionsFromTemplate(temp);
|
||||
}
|
||||
|
||||
void NewX509::toTemplate(pki_temp *temp)
|
||||
{
|
||||
temp->setIntName(description->text());
|
||||
@ -492,18 +505,30 @@ void NewX509::templateChanged(pki_temp *templ)
|
||||
templateChanged(tempname);
|
||||
}
|
||||
|
||||
void NewX509::on_applyTemplate_clicked()
|
||||
pki_temp *NewX509::currentTemplate()
|
||||
{
|
||||
pki_temp *temp = NULL;
|
||||
if (!tempList->isEnabled())
|
||||
return;
|
||||
return NULL;
|
||||
QString name = tempList->currentText();
|
||||
if (name.isEmpty())
|
||||
return;
|
||||
temp = (pki_temp *)MainWindow::temps->getByName(name);
|
||||
if (!temp)
|
||||
return;
|
||||
fromTemplate(temp);
|
||||
return NULL;
|
||||
return (pki_temp *)MainWindow::temps->getByName(name);
|
||||
}
|
||||
|
||||
void NewX509::on_applyTemplate_clicked()
|
||||
{
|
||||
fromTemplate(currentTemplate());
|
||||
}
|
||||
|
||||
void NewX509::on_applySubject_clicked()
|
||||
{
|
||||
subjectFromTemplate(currentTemplate());
|
||||
}
|
||||
|
||||
void NewX509::on_applyExtensionse_clicked()
|
||||
{
|
||||
extensionsFromTemplate(currentTemplate());
|
||||
}
|
||||
|
||||
void NewX509::on_foreignSignRB_toggled(bool checked)
|
||||
|
||||
@ -89,6 +89,10 @@ class NewX509: public QDialog, public Ui::NewX509
|
||||
void switchHashAlgo();
|
||||
void addReqAttributes(pki_x509req *req);
|
||||
int checkExtDuplicates();
|
||||
void subjectFromTemplate(pki_temp *temp);
|
||||
void extensionsFromTemplate(pki_temp *temp);
|
||||
pki_temp *currentTemplate();
|
||||
|
||||
public slots:
|
||||
void on_fromReqCB_clicked();
|
||||
void on_keyList_currentIndexChanged(const QString &);
|
||||
@ -106,6 +110,8 @@ class NewX509: public QDialog, public Ui::NewX509
|
||||
void on_showReqBut_clicked();
|
||||
void on_certList_currentIndexChanged(int index);
|
||||
void on_applyTemplate_clicked();
|
||||
void on_applySubject_clicked();
|
||||
void on_applyExtensionse_clicked();
|
||||
void on_adv_validate_clicked();
|
||||
void on_usedKeysToo_toggled(bool checked);
|
||||
void on_tabWidget_currentChanged(int idx);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user