mirror of
https://github.com/chris2511/xca.git
synced 2026-09-14 11:06:19 +05:00
Creating a request works
This commit is contained in:
parent
11bcd48d55
commit
bbba019c39
@ -9,4 +9,14 @@ void MainWindow::newX509Req()
|
||||
RSAkey *key = keys->getSelectedKey(dlg->keyList->currentText());
|
||||
X509Req *req = new X509Req(key, this);
|
||||
cerr << "HIIIIEEER\n";
|
||||
QString cn = dlg->commonName->text();
|
||||
QString c = dlg->countryName->text();
|
||||
QString l = dlg->localityName->text();
|
||||
QString st = dlg->stateOrProvinceName->text();
|
||||
QString o = dlg->organisationName->text();
|
||||
QString ou = dlg->organisationalUnitName->text();
|
||||
QString email = dlg->emailAddress->text();
|
||||
req->setDN(cn.latin1(),c.latin1(),l.latin1(),st.latin1(),o.latin1(),ou.latin1(),email.latin1());
|
||||
req->sign(key);
|
||||
cerr << "HIIIIEEER\n";
|
||||
}
|
||||
|
||||
588
NewX509Req.ui
588
NewX509Req.ui
@ -11,7 +11,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>648</width>
|
||||
<width>644</width>
|
||||
<height>443</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -47,298 +47,6 @@
|
||||
<string>Zertifikat - Unterschriftsanfrage</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QFrame</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>Frame7</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>130</y>
|
||||
<width>310</width>
|
||||
<height>240</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>frameShape</name>
|
||||
<enum>Box</enum>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>frameShadow</name>
|
||||
<enum>Sunken</enum>
|
||||
</property>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel2</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Länderkürzel:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel3</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Land:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel4</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Stadt:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel4_2</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Firmenname:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel5</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>140</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Abteilung:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel7</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>200</y>
|
||||
<width>90</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>E-Mail adresse:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel6</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>170</y>
|
||||
<width>90</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Name , DNS:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>countyName</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>20</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>DE</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>stateOrProvinceName</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>50</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Germany</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>localityName</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>80</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>organisationName</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>110</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>organisationalUnitName</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>140</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>commonName</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>170</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>emailAddress</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>200</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QFrame</class>
|
||||
<property stdset="1">
|
||||
@ -572,6 +280,298 @@
|
||||
<string>Zertifikat beantragen</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QFrame</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>Frame7</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>130</y>
|
||||
<width>310</width>
|
||||
<height>240</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>frameShape</name>
|
||||
<enum>Box</enum>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>frameShadow</name>
|
||||
<enum>Sunken</enum>
|
||||
</property>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel2</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Länderkürzel:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel4</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Stadt:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel4_2</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Firmenname:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel5</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>140</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Abteilung:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel7</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>200</y>
|
||||
<width>90</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>E-Mail adresse:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel6</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>170</y>
|
||||
<width>90</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Name , DNS:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>countryName</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>20</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>DE</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>stateOrProvinceName</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>50</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Germany</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>localityName</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>80</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>organisationName</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>110</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>organisationalUnitName</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>140</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>commonName</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>170</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>emailAddress</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>200</y>
|
||||
<width>180</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel3</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Land:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<connections>
|
||||
<connection>
|
||||
@ -588,7 +588,7 @@
|
||||
</connection>
|
||||
</connections>
|
||||
<tabstops>
|
||||
<tabstop>countyName</tabstop>
|
||||
<tabstop>countryName</tabstop>
|
||||
<tabstop>stateOrProvinceName</tabstop>
|
||||
<tabstop>localityName</tabstop>
|
||||
<tabstop>organisationName</tabstop>
|
||||
|
||||
17
RSAkey.cpp
17
RSAkey.cpp
@ -16,6 +16,7 @@ RSAkey::RSAkey(const QString d, int bits,
|
||||
error = NULL;
|
||||
if ((key = RSA_generate_key(bits, 0x10001, cb, prog)) == NULL)
|
||||
openssl_error();
|
||||
initevp();
|
||||
}
|
||||
|
||||
|
||||
@ -65,6 +66,7 @@ RSAkey::RSAkey(const QString fname, pem_password_cb *cb, QObject *parent=0, cons
|
||||
}
|
||||
else error = "Fehler beim Öffnen der Datei";
|
||||
fclose(fp);
|
||||
initevp();
|
||||
|
||||
}
|
||||
|
||||
@ -81,6 +83,7 @@ RSAkey::RSAkey(unsigned char *p, int size)
|
||||
}
|
||||
if (openssl_error());
|
||||
OPENSSL_free(sik);
|
||||
initevp();
|
||||
}
|
||||
|
||||
unsigned char *RSAkey::getKey(int *size)
|
||||
@ -113,11 +116,23 @@ RSAkey::RSAkey(RSA *rsa, QString &d, QObject *parent=0, const char *name=0)
|
||||
key = rsa;
|
||||
desc = d;
|
||||
}
|
||||
void RSAkey::initevp()
|
||||
{
|
||||
evp = EVP_PKEY_new();
|
||||
EVP_PKEY_assign_RSA(evp,key);
|
||||
}
|
||||
|
||||
|
||||
EVP_PKEY *RSAkey::evpkey()
|
||||
{
|
||||
return evp;
|
||||
}
|
||||
|
||||
|
||||
RSAkey::~RSAkey()
|
||||
{
|
||||
RSA_free(key);
|
||||
//RSA_free(key);
|
||||
EVP_PKEY_free(evp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
3
RSAkey.h
3
RSAkey.h
@ -21,12 +21,15 @@ class RSAkey: public QObject
|
||||
Q_OBJECT
|
||||
|
||||
RSA *key;
|
||||
EVP_PKEY *evp;
|
||||
QString desc;
|
||||
char *error;
|
||||
QString BN2QString(BIGNUM *bn);
|
||||
char *openssl_error();
|
||||
void initevp();
|
||||
public:
|
||||
bool onlyPubKey;
|
||||
EVP_PKEY *evpkey();
|
||||
RSAkey(const QString d, int bits,
|
||||
void (*cb)(int, int,void *),void *prog,
|
||||
QObject *parent=0, const char *name=0);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user