mirror of
https://github.com/chris2511/xca.git
synced 2026-09-12 19:51:05 +05:00
Add advanced extension text to the template
- add donator info - extend template format - rename X-CA to XCA in the desktop file
This commit is contained in:
parent
2299d2b59c
commit
9f0aab7b79
@ -47,13 +47,14 @@ pki_temp::pki_temp(const pki_temp *pk)
|
||||
validMidn=pk->validMidn;
|
||||
keyUse=pk->keyUse;
|
||||
eKeyUse=pk->eKeyUse;
|
||||
adv_ext=pk->adv_ext;
|
||||
}
|
||||
|
||||
pki_temp::pki_temp(const QString d)
|
||||
:pki_base(d)
|
||||
{
|
||||
class_name = "pki_temp";
|
||||
dataVersion=2;
|
||||
dataVersion=3;
|
||||
pkiType=tmpl;
|
||||
cols=2;
|
||||
|
||||
@ -82,6 +83,7 @@ pki_temp::pki_temp(const QString d)
|
||||
validM=0;
|
||||
keyUse=0;
|
||||
eKeyUse=0;
|
||||
adv_ext="";
|
||||
}
|
||||
|
||||
|
||||
@ -94,7 +96,7 @@ void pki_temp::fromData(const unsigned char *p, db_header_t *head )
|
||||
fromData(p, size, version);
|
||||
}
|
||||
|
||||
void pki_temp::fromData(const unsigned char *p, int size, int)
|
||||
void pki_temp::fromData(const unsigned char *p, int size, int version)
|
||||
{
|
||||
const unsigned char *p1 = p;
|
||||
|
||||
@ -125,7 +127,8 @@ void pki_temp::fromData(const unsigned char *p, int size, int)
|
||||
authInfAcc=db::stringFromData(&p1);
|
||||
certPol=db::stringFromData(&p1);
|
||||
validMidn=db::boolFromData(&p1);
|
||||
|
||||
if (version>2)
|
||||
adv_ext=db::stringFromData(&p1);
|
||||
if (p1-p != size) {
|
||||
my_error(tr("Wrong Size of template: ") + getIntName());
|
||||
}
|
||||
@ -166,6 +169,7 @@ unsigned char *pki_temp::toData(int *size)
|
||||
db::stringToData(&p1, authInfAcc);
|
||||
db::stringToData(&p1, certPol);
|
||||
db::boolToData(&p1, validMidn);
|
||||
db::stringToData(&p1, adv_ext);
|
||||
|
||||
*size = p1-p;
|
||||
return p;
|
||||
@ -250,9 +254,8 @@ pki_temp::~pki_temp()
|
||||
|
||||
int pki_temp::dataSize()
|
||||
{
|
||||
int s = 9 * sizeof(int) +
|
||||
8 * sizeof(char) +
|
||||
xname.derSize() + (
|
||||
int s = 9 * sizeof(int) + 8 * sizeof(char) +
|
||||
xname.derSize() + (
|
||||
subAltName.length() +
|
||||
issAltName.length() +
|
||||
crlDist.length() +
|
||||
@ -265,7 +268,8 @@ int pki_temp::dataSize()
|
||||
nsRenewalUrl.length() +
|
||||
nsCaPolicyUrl.length() +
|
||||
nsSslServerName.length() +
|
||||
12 ) * sizeof(char);
|
||||
adv_ext.length() +
|
||||
13 ) * sizeof(char);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@ -15,14 +15,14 @@
|
||||
class pki_temp: public pki_base
|
||||
{
|
||||
protected:
|
||||
int version;
|
||||
int dataSize();
|
||||
public:
|
||||
static QPixmap *icon;
|
||||
x509name xname;
|
||||
QString subAltName, issAltName, crlDist, authInfAcc, certPol;
|
||||
QString nsComment, nsBaseUrl, nsRevocationUrl, nsCARevocationUrl,
|
||||
nsRenewalUrl, nsCaPolicyUrl, nsSslServerName, destination;
|
||||
nsRenewalUrl, nsCaPolicyUrl, nsSslServerName, destination,
|
||||
adv_ext;
|
||||
bool bcCrit, keyUseCrit, eKeyUseCrit, subKey, authKey, validMidn;
|
||||
int nsCertType, pathLen, keyUse, eKeyUse, ca;
|
||||
int validN, validM;
|
||||
@ -33,7 +33,6 @@ class pki_temp: public pki_base
|
||||
pki_temp(const QString d = QString());
|
||||
void fload(const QString fname);
|
||||
void writeDefault(const QString fname);
|
||||
/* destructor */
|
||||
~pki_temp();
|
||||
void fromData(const unsigned char *p, int size, int version);
|
||||
void fromData(const unsigned char *p, db_header_t *head );
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=X-CA
|
||||
Name=XCA
|
||||
Type=Application
|
||||
Comment=A graphical user interface for handling and issuing X.509 compliant Certificates
|
||||
Comment[de]=Eine graphische Oberfläche zur Erstellung von X.509 konformen Zertifikaten
|
||||
|
||||
@ -56,8 +56,11 @@ void MainWindow::about()
|
||||
"<tr><th align=left>Wolfgang Glas</th><td><u><wolfgang.glas@ev-i.at></u></td></tr>"
|
||||
"<tr><td></td><td>SPKAC support and Testing</td></tr>"
|
||||
"</table><hr><center><u><b>General support</b></u></center>"
|
||||
"<p><b>Mark Foster</b> <u><mark@foster.cc></u><br>"
|
||||
"<b>Thorsten Weiss</b> <u><weiss2@gmx.de></u>",
|
||||
"<p><table>"
|
||||
"<tr><td><b>Mark Foster</b></td><td><u><mark@foster.cc></u></td></tr>"
|
||||
"<tr><td><b>Thorsten Weiss</b></td><td><u><weiss2@gmx.de></u></td></tr>"
|
||||
"<tr><td><b>Oobj</b></td><td><u><www.oobj.com.br></u></td></tr>"
|
||||
"</table>",
|
||||
OPENSSL_VERSION_TEXT, QT_VERSION_STR );
|
||||
|
||||
about->setWindowTitle(tr(XCA_TITLE));
|
||||
|
||||
@ -299,6 +299,7 @@ void NewX509::fromTemplate(pki_temp *temp)
|
||||
if (temp->pathLen) {
|
||||
basicPath->setText(QString::number(temp->pathLen));
|
||||
}
|
||||
nconf_data->document()->setPlainText(temp->adv_ext);
|
||||
notBefore->setNow();
|
||||
on_applyTime_clicked();
|
||||
}
|
||||
@ -331,6 +332,7 @@ void NewX509::toTemplate(pki_temp *temp)
|
||||
temp->validM = validRange->currentIndex();
|
||||
temp->pathLen = basicPath->text().toInt();
|
||||
temp->validMidn = midnightCB->isChecked();
|
||||
temp->adv_ext = nconf_data->toPlainText();
|
||||
}
|
||||
|
||||
void NewX509::on_fromReqCB_clicked()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user