mirror of
https://github.com/chris2511/xca.git
synced 2026-09-14 11:06:19 +05:00
std:: added
This commit is contained in:
parent
cc1f1ff764
commit
cafc1cbec3
@ -4,7 +4,7 @@
|
||||
<class>QDialog</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>ExportKey_UI</cstring>
|
||||
<cstd::string>ExportKey_UI</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
@ -17,7 +17,7 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>caption</name>
|
||||
<string>Key export</string>
|
||||
<std::string>Key export</std::string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property stdset="1">
|
||||
@ -32,7 +32,7 @@
|
||||
<class>QLayoutWidget</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>Layout9</cstring>
|
||||
<cstd::string>Layout9</cstd::string>
|
||||
</property>
|
||||
<hbox>
|
||||
<property stdset="1">
|
||||
@ -47,7 +47,7 @@
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel12</cstring>
|
||||
<cstd::string>TextLabel12</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>font</name>
|
||||
@ -59,13 +59,13 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Key export</string>
|
||||
<std::string>Key export</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property>
|
||||
<name>name</name>
|
||||
<cstring>Spacer6</cstring>
|
||||
<cstd::string>Spacer6</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>orientation</name>
|
||||
@ -87,7 +87,7 @@
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>image</cstring>
|
||||
<cstd::string>image</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>minimumSize</name>
|
||||
@ -114,11 +114,11 @@
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel13</cstring>
|
||||
<cstd::string>TextLabel13</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Please enter the filename for the key.</string>
|
||||
<std::string>Please enter the filename for the key.</std::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>alignment</name>
|
||||
@ -132,7 +132,7 @@
|
||||
<class>QFrame</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>Frame5_2</cstring>
|
||||
<cstd::string>Frame5_2</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>frameShape</name>
|
||||
@ -155,25 +155,25 @@
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel14</cstring>
|
||||
<cstd::string>TextLabel14</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Filename:</string>
|
||||
<std::string>Filename:</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>filename</cstring>
|
||||
<cstd::string>filename</cstd::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QToolButton</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>ToolButton1</cstring>
|
||||
<cstd::string>ToolButton1</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>sizePolicy</name>
|
||||
@ -184,7 +184,7 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>...</string>
|
||||
<std::string>...</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
@ -193,13 +193,13 @@
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel3</cstring>
|
||||
<cstd::string>TextLabel3</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>DER is a binary format of the key without encryption
|
||||
<std::string>DER is a binary format of the key without encryption
|
||||
PEM is a base64 encoded key with optional encryption
|
||||
PKCS#8 is an encrypted official Key-exchange format</string>
|
||||
PKCS#8 is an encrypted official Key-exchange format</std::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>alignment</name>
|
||||
@ -213,7 +213,7 @@ PKCS#8 is an encrypted official Key-exchange format</string>
|
||||
<class>QFrame</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>Frame4</cstring>
|
||||
<cstd::string>Frame4</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>frameShape</name>
|
||||
@ -236,18 +236,18 @@ PKCS#8 is an encrypted official Key-exchange format</string>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel1</cstring>
|
||||
<cstd::string>TextLabel1</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Export Format:</string>
|
||||
<std::string>Export Format:</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QComboBox</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>exportFormat</cstring>
|
||||
<cstd::string>exportFormat</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>sizePolicy</name>
|
||||
@ -263,11 +263,11 @@ PKCS#8 is an encrypted official Key-exchange format</string>
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel2</cstring>
|
||||
<cstd::string>TextLabel2</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>When exporting the private key it should be encrypted.</string>
|
||||
<std::string>When exporting the private key it should be encrypted.</std::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>alignment</name>
|
||||
@ -281,7 +281,7 @@ PKCS#8 is an encrypted official Key-exchange format</string>
|
||||
<class>QFrame</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>privFrame</cstring>
|
||||
<cstd::string>privFrame</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>frameShape</name>
|
||||
@ -304,18 +304,18 @@ PKCS#8 is an encrypted official Key-exchange format</string>
|
||||
<class>QCheckBox</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>exportPrivate</cstring>
|
||||
<cstd::string>exportPrivate</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Export the private part of the Key too</string>
|
||||
<std::string>Export the private part of the Key too</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QCheckBox</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>encryptKey</cstring>
|
||||
<cstd::string>encryptKey</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>enabled</name>
|
||||
@ -323,7 +323,7 @@ PKCS#8 is an encrypted official Key-exchange format</string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Encrypt the Key with a password</string>
|
||||
<std::string>Encrypt the Key with a password</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
@ -332,7 +332,7 @@ PKCS#8 is an encrypted official Key-exchange format</string>
|
||||
<class>QLayoutWidget</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>Layout6</cstring>
|
||||
<cstd::string>Layout6</cstd::string>
|
||||
</property>
|
||||
<hbox>
|
||||
<property stdset="1">
|
||||
@ -347,17 +347,17 @@ PKCS#8 is an encrypted official Key-exchange format</string>
|
||||
<class>QPushButton</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>PushButton9</cstring>
|
||||
<cstd::string>PushButton9</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Cancel</string>
|
||||
<std::string>Cancel</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property>
|
||||
<name>name</name>
|
||||
<cstring>Spacer7</cstring>
|
||||
<cstd::string>Spacer7</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>orientation</name>
|
||||
@ -379,11 +379,11 @@ PKCS#8 is an encrypted official Key-exchange format</string>
|
||||
<class>QPushButton</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>PushButton7</cstring>
|
||||
<cstd::string>PushButton7</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>OK</string>
|
||||
<std::string>OK</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
|
||||
@ -163,10 +163,10 @@ QPixmap *MainWindow::loadImg(const char *name )
|
||||
void MainWindow::initPass()
|
||||
{
|
||||
PASS_INFO p;
|
||||
string passHash = settings->getString("pwhash");
|
||||
std::string passHash = settings->getString("pwhash");
|
||||
if (passHash == "") {
|
||||
string title=tr("New Password").latin1();
|
||||
string description=tr("Please enter a password, that will be used to encrypt your private keys in the database-file").latin1();
|
||||
std::string title=tr("New Password").latin1();
|
||||
std::string description=tr("Please enter a password, that will be used to encrypt your private keys in the database-file").latin1();
|
||||
p.title = &title;
|
||||
p.description = &description;
|
||||
int keylen = passWrite((char *)pki_key::passwd, 25, 0, &p);
|
||||
@ -181,8 +181,8 @@ void MainWindow::initPass()
|
||||
while (md5passwd() != passHash) {
|
||||
if (keylen !=0)
|
||||
QMessageBox::warning(this,tr(XCA_TITLE), tr("Password verify error, please try again"));
|
||||
string title=tr("Password").latin1();
|
||||
string description=tr("Please enter the password for unlocking the database").latin1();
|
||||
std::string title=tr("Password").latin1();
|
||||
std::string description=tr("Please enter the password for unlocking the database").latin1();
|
||||
p.title = &title;
|
||||
p.description = &description;
|
||||
keylen = passRead(pki_key::passwd, 25, 0, &p);
|
||||
@ -257,11 +257,11 @@ void MainWindow::incProgress(int a, int b, void *progress)
|
||||
}
|
||||
|
||||
|
||||
string MainWindow::md5passwd()
|
||||
std::string MainWindow::md5passwd()
|
||||
{
|
||||
|
||||
EVP_MD_CTX mdctx;
|
||||
string str;
|
||||
std::string str;
|
||||
unsigned int n;
|
||||
int j;
|
||||
char zs[4];
|
||||
@ -278,7 +278,7 @@ string MainWindow::md5passwd()
|
||||
|
||||
bool MainWindow::opensslError(pki_base *pki)
|
||||
{
|
||||
string err;
|
||||
std::string err;
|
||||
|
||||
if (!pki) {
|
||||
QMessageBox::warning(this,tr(XCA_TITLE), tr("The system detected a NULL pointer, maybe the system is out of memory" ));
|
||||
@ -318,7 +318,7 @@ void MainWindow::dberr(const char *errpfx, char *msg)
|
||||
|
||||
void MainWindow::setPath(QFileDialog *dlg)
|
||||
{
|
||||
string wd = settings->getString("workingdir");
|
||||
std::string wd = settings->getString("workingdir");
|
||||
if (!wd.empty()) {
|
||||
dlg->setDir(QString(wd.c_str()));
|
||||
}
|
||||
@ -326,6 +326,6 @@ void MainWindow::setPath(QFileDialog *dlg)
|
||||
|
||||
void MainWindow::newPath(QFileDialog *dlg)
|
||||
{
|
||||
string wd = dlg->dirPath().latin1();
|
||||
std::string wd = dlg->dirPath().latin1();
|
||||
settings->putString("workingdir", wd);
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ class MainWindow: public MainWindow_UI
|
||||
{
|
||||
Q_OBJECT
|
||||
protected:
|
||||
void addStr(string &str, const char *add);
|
||||
void addStr(std::std::string &str, const char *add);
|
||||
friend class pki_key;
|
||||
db_x509 *certs;
|
||||
db_x509req *reqs;
|
||||
@ -140,7 +140,7 @@ class MainWindow: public MainWindow_UI
|
||||
void insertReq(pki_x509req *req);
|
||||
void insertCert(pki_x509 *cert);
|
||||
void insertTemp(pki_temp *temp);
|
||||
string md5passwd();
|
||||
std::std::string md5passwd();
|
||||
bool opensslError(pki_base *pki);
|
||||
QPixmap *loadImg(const char *name);
|
||||
void renamePKI(db_base *db);
|
||||
|
||||
@ -155,7 +155,7 @@ bool MainWindow::showDetailsKey(pki_key *key, bool import)
|
||||
return false;
|
||||
}
|
||||
bool ret = detDlg->exec();
|
||||
string ndesc = detDlg->keyDesc->text().latin1();
|
||||
std::string ndesc = detDlg->keyDesc->text().latin1();
|
||||
delete detDlg;
|
||||
CERR(ndesc << " " << key->getDescription());
|
||||
if ( ret && ndesc != key->getDescription()) {
|
||||
@ -183,7 +183,7 @@ void MainWindow::showDetailsKey()
|
||||
|
||||
void MainWindow::showDetailsKey(QListViewItem *item)
|
||||
{
|
||||
string key = item->text(0).latin1();
|
||||
std::string key = item->text(0).latin1();
|
||||
showDetailsKey((pki_key *)keys->getSelectedPKI(key));
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ void MainWindow::writeKey()
|
||||
delete dlg;
|
||||
return;
|
||||
}
|
||||
string fname = dlg->filename->text().latin1();
|
||||
std::string fname = dlg->filename->text().latin1();
|
||||
if (fname == "") {
|
||||
delete dlg;
|
||||
return;
|
||||
@ -319,7 +319,7 @@ void MainWindow::renameKey(QListViewItem *item, int col, const QString &text)
|
||||
{
|
||||
try {
|
||||
pki_base *pki = keys->getSelectedPKI(item);
|
||||
string txt = text.latin1();
|
||||
std::string txt = text.latin1();
|
||||
keys->renamePKI(pki, txt);
|
||||
}
|
||||
catch (errorEx &err) {
|
||||
|
||||
@ -83,9 +83,9 @@ void MainWindow::alterTemp()
|
||||
pki_temp *temp = (pki_temp *)temps->getSelectedPKI();
|
||||
if (!temp) return;
|
||||
MARK
|
||||
string oldname = temp->getDescription();
|
||||
std::std::string oldname = temp->getDescription();
|
||||
alterTemp(temp);
|
||||
string newname = temp->getDescription();
|
||||
std::std::string newname = temp->getDescription();
|
||||
if (newname!= oldname) {
|
||||
temp->setDescription(oldname);
|
||||
temps->renamePKI(temp, newname);
|
||||
@ -154,7 +154,7 @@ void MainWindow::showPopupTemp(QListViewItem *item, const QPoint &pt, int x) {
|
||||
void MainWindow::renameTemp(QListViewItem *item, int col, const QString &text)
|
||||
{
|
||||
pki_base *pki = temps->getSelectedPKI(item);
|
||||
string txt = text.latin1();
|
||||
std::std::string txt = text.latin1();
|
||||
temps->renamePKI(pki, txt);
|
||||
}
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ void MainWindow::newCert(NewX509 *dlg)
|
||||
int serial = 42; // :-)
|
||||
bool tempReq=false;
|
||||
int i, x, days;
|
||||
string cont="", subAltName="", issAltName="", constraints="",
|
||||
std::std::string cont="", subAltName="", issAltName="", constraints="",
|
||||
keyuse="", keyuse1="", pathstr="", certTypeStr = "";
|
||||
char *ekeyusage[]= {"serverAuth","clientAuth","codeSigning","emailProtection",
|
||||
"timeStamping","msCodeInd","msCodeCom",
|
||||
@ -113,14 +113,14 @@ void MainWindow::newCert(NewX509 *dlg)
|
||||
// Step 1 - Subject and key
|
||||
if (!dlg->fromReqCB->isChecked()) {
|
||||
clientkey = (pki_key *)keys->getSelectedPKI(dlg->keyList->currentText().latin1());
|
||||
std::string cn = dlg->commonName->text().latin1();
|
||||
std::string c = dlg->countryName->text().latin1();
|
||||
std::string l = dlg->localityName->text().latin1();
|
||||
std::string st = dlg->stateOrProvinceName->text().latin1();
|
||||
std::string o = dlg->organisationName->text().latin1();
|
||||
std::string ou = dlg->organisationalUnitName->text().latin1();
|
||||
std::string email = dlg->emailAddress->text().latin1();
|
||||
std::string desc = dlg->description->text().latin1();
|
||||
std::std::string cn = dlg->commonName->text().latin1();
|
||||
std::std::string c = dlg->countryName->text().latin1();
|
||||
std::std::string l = dlg->localityName->text().latin1();
|
||||
std::std::string st = dlg->stateOrProvinceName->text().latin1();
|
||||
std::std::string o = dlg->organisationName->text().latin1();
|
||||
std::std::string ou = dlg->organisationalUnitName->text().latin1();
|
||||
std::std::string email = dlg->emailAddress->text().latin1();
|
||||
std::std::string desc = dlg->description->text().latin1();
|
||||
tempReq = true;
|
||||
req = new pki_x509req(clientkey, cn,c,l,st,o,ou,email,desc,"");
|
||||
}
|
||||
@ -159,7 +159,7 @@ void MainWindow::newCert(NewX509 *dlg)
|
||||
// get own serial to avoid having the same
|
||||
int sigser;
|
||||
sscanf(signcert->getSerial().c_str(), "%x", &sigser);
|
||||
if (serial == sigser) { // FIXME: anybody tell me the std::string method for this ?
|
||||
if (serial == sigser) { // FIXME: anybody tell me the std::std::string method for this ?
|
||||
serial = signcert->getIncCaSerial(); // just take the next one
|
||||
}
|
||||
certs->updatePKI(signcert); // not so pretty ....
|
||||
@ -190,13 +190,13 @@ void MainWindow::newCert(NewX509 *dlg)
|
||||
cert->addV3ext(NID_basic_constraints, constraints);
|
||||
// Subject Key identifier
|
||||
if (dlg->subKey->isChecked()) {
|
||||
string subkey="hash";
|
||||
std::std::string subkey="hash";
|
||||
cert->addV3ext(NID_subject_key_identifier, subkey);
|
||||
CERR( subkey );
|
||||
}
|
||||
// Authority Key identifier
|
||||
if (dlg->authKey->isChecked()) {
|
||||
string authkey="keyid:always,issuer:always";
|
||||
std::std::string authkey="keyid:always,issuer:always";
|
||||
cert->addV3ext(NID_authority_key_identifier, authkey);
|
||||
CERR( authkey );
|
||||
}
|
||||
@ -314,9 +314,9 @@ void MainWindow::newCert(NewX509 *dlg)
|
||||
}
|
||||
|
||||
}
|
||||
void MainWindow::addStr(string &str, const char *add)
|
||||
void MainWindow::addStr(std::std::string &str, const char *add)
|
||||
{
|
||||
string sadd = add;
|
||||
std::std::string sadd = add;
|
||||
if (sadd.length() == 0) return;
|
||||
if (str.length() > 0 ) {
|
||||
str += ", ";
|
||||
@ -342,7 +342,7 @@ void MainWindow::extendCert()
|
||||
serial = signer->getIncCaSerial();
|
||||
|
||||
// get signers own serial to avoid having the same
|
||||
if (serial == atoi(signer->getSerial().c_str())) { // FIXME: anybody tell me the std::string method for this ?
|
||||
if (serial == atoi(signer->getSerial().c_str())) { // FIXME: anybody tell me the std::std::string method for this ?
|
||||
serial = signer->getIncCaSerial(); // just take the next one
|
||||
}
|
||||
certs->updatePKI(signer); // not so pretty ....
|
||||
@ -388,7 +388,7 @@ void MainWindow::showDetailsCert()
|
||||
|
||||
void MainWindow::showDetailsCert(QListViewItem *item)
|
||||
{
|
||||
string cert = item->text(0).latin1();
|
||||
std::std::string cert = item->text(0).latin1();
|
||||
showDetailsCert((pki_x509 *)certs->getSelectedPKI(cert));
|
||||
}
|
||||
|
||||
@ -433,8 +433,8 @@ bool MainWindow::showDetailsCert(pki_x509 *cert, bool import)
|
||||
dlg->serialNr->setText(cert->getSerial().c_str());
|
||||
|
||||
// details of subject
|
||||
string land = cert->getDNs(NID_countryName);
|
||||
string land1 = cert->getDNs(NID_stateOrProvinceName);
|
||||
std::std::string land = cert->getDNs(NID_countryName);
|
||||
std::std::string land1 = cert->getDNs(NID_stateOrProvinceName);
|
||||
if (land != "" && land1 != "")
|
||||
land += " / " +land1;
|
||||
else
|
||||
@ -471,7 +471,7 @@ bool MainWindow::showDetailsCert(pki_x509 *cert, bool import)
|
||||
dlg->dateValid->setText(tr("Not valid"));
|
||||
dlg->dateValid->setDisabled(true);
|
||||
}
|
||||
string revdate = cert->revokedAt();
|
||||
std::std::string revdate = cert->revokedAt();
|
||||
if (revdate != "") {
|
||||
dlg->dateValid->setText(tr("Revoked: ")+ revdate.c_str());
|
||||
dlg->dateValid->setDisabled(true);
|
||||
@ -492,7 +492,7 @@ bool MainWindow::showDetailsCert(pki_x509 *cert, bool import)
|
||||
|
||||
// show it to the user...
|
||||
if (dlg->exec()) {
|
||||
string ndesc = dlg->descr->text().latin1();
|
||||
std::std::string ndesc = dlg->descr->text().latin1();
|
||||
if (ndesc != cert->getDescription()) {
|
||||
certs->renamePKI(cert, ndesc);
|
||||
}
|
||||
@ -874,7 +874,7 @@ void MainWindow::renameCert(QListViewItem *item, int col, const QString &text)
|
||||
if (col != 0) return;
|
||||
try {
|
||||
pki_base *pki = certs->getSelectedPKI(item);
|
||||
string txt = text.latin1();
|
||||
std::std::string txt = text.latin1();
|
||||
certs->renamePKI(pki, txt);
|
||||
}
|
||||
catch (errorEx &err) {
|
||||
|
||||
@ -66,14 +66,14 @@ void MainWindow::newReq(pki_temp *temp)
|
||||
}
|
||||
try {
|
||||
pki_key *key = (pki_key *)keys->getSelectedPKI(dlg->keyList->currentText().latin1());
|
||||
string cn = dlg->commonName->text().latin1();
|
||||
string c = dlg->countryName->text().latin1();
|
||||
string l = dlg->localityName->text().latin1();
|
||||
string st = dlg->stateOrProvinceName->text().latin1();
|
||||
string o = dlg->organisationName->text().latin1();
|
||||
string ou = dlg->organisationalUnitName->text().latin1();
|
||||
string email = dlg->emailAddress->text().latin1();
|
||||
string desc = dlg->description->text().latin1();
|
||||
std::string cn = dlg->commonName->text().latin1();
|
||||
std::string c = dlg->countryName->text().latin1();
|
||||
std::string l = dlg->localityName->text().latin1();
|
||||
std::string st = dlg->stateOrProvinceName->text().latin1();
|
||||
std::string o = dlg->organisationName->text().latin1();
|
||||
std::string ou = dlg->organisationalUnitName->text().latin1();
|
||||
std::string email = dlg->emailAddress->text().latin1();
|
||||
std::string desc = dlg->description->text().latin1();
|
||||
pki_x509req *req = new pki_x509req(key, cn,c,l,st,o,ou,email,desc, "");
|
||||
insertReq(req);
|
||||
}
|
||||
@ -90,7 +90,7 @@ void MainWindow::showDetailsReq()
|
||||
}
|
||||
void MainWindow::showDetailsReq(QListViewItem *item)
|
||||
{
|
||||
string req = item->text(0).latin1();
|
||||
std::string req = item->text(0).latin1();
|
||||
showDetailsReq((pki_x509req *)reqs->getSelectedPKI(req));
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ void MainWindow::showDetailsReq(pki_x509req *req)
|
||||
dlg->privKey->setText(key->getDescription().c_str());
|
||||
dlg->privKey->setDisabled(false);
|
||||
}
|
||||
string land = req->getDN( NID_countryName) + " / "
|
||||
std::string land = req->getDN( NID_countryName) + " / "
|
||||
+ req->getDN(NID_stateOrProvinceName);
|
||||
dlg->dnCN->setText(req->getDN(NID_commonName).c_str() );
|
||||
dlg->dnC->setText(land.c_str());
|
||||
@ -127,7 +127,7 @@ void MainWindow::showDetailsReq(pki_x509req *req)
|
||||
dlg->dnEmail->setText(req->getDN(NID_pkcs9_emailAddress).c_str());
|
||||
dlg->image->setPixmap(*csrImg);
|
||||
if (dlg->exec()) {
|
||||
string ndesc = dlg->descr->text().latin1();
|
||||
std::string ndesc = dlg->descr->text().latin1();
|
||||
if (ndesc != req->getDescription()) {
|
||||
reqs->renamePKI(req, ndesc);
|
||||
}
|
||||
@ -305,7 +305,7 @@ void MainWindow::renameReq(QListViewItem *item, int col, const QString &text)
|
||||
{
|
||||
try {
|
||||
pki_base *pki = reqs->getSelectedPKI(item);
|
||||
string txt = text.latin1();
|
||||
std::string txt = text.latin1();
|
||||
reqs->renamePKI(pki, txt);
|
||||
}
|
||||
catch (errorEx &err) {
|
||||
|
||||
@ -83,7 +83,7 @@ NewX509::NewX509(QWidget *parent , const char *name, db_key *key, db_x509req *re
|
||||
//setFont( tFont );
|
||||
#endif
|
||||
serialNr->setValidator( new QIntValidator(0, 32767, this));
|
||||
QStringList std::strings;
|
||||
QStringList strings;
|
||||
// are there any useable private keys ?
|
||||
if (keys) {
|
||||
strings = keys->get0PrivateDesc();
|
||||
|
||||
106
ReqDetail.ui
106
ReqDetail.ui
@ -4,7 +4,7 @@
|
||||
<class>QDialog</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>ReqDetail_UI</cstring>
|
||||
<cstd::string>ReqDetail_UI</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
@ -17,7 +17,7 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>caption</name>
|
||||
<string>Details of the request</string>
|
||||
<std::string>Details of the request</std::string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property stdset="1">
|
||||
@ -32,7 +32,7 @@
|
||||
<class>QLayoutWidget</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>Layout12</cstring>
|
||||
<cstd::string>Layout12</cstd::string>
|
||||
</property>
|
||||
<hbox>
|
||||
<property stdset="1">
|
||||
@ -47,7 +47,7 @@
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel1</cstring>
|
||||
<cstd::string>TextLabel1</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>font</name>
|
||||
@ -59,13 +59,13 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Details of the certificate signing request</string>
|
||||
<std::string>Details of the certificate signing request</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property>
|
||||
<name>name</name>
|
||||
<cstring>Spacer5</cstring>
|
||||
<cstd::string>Spacer5</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>orientation</name>
|
||||
@ -87,7 +87,7 @@
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>image</cstring>
|
||||
<cstd::string>image</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>minimumSize</name>
|
||||
@ -113,7 +113,7 @@
|
||||
<spacer>
|
||||
<property>
|
||||
<name>name</name>
|
||||
<cstring>Spacer7</cstring>
|
||||
<cstd::string>Spacer7</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>orientation</name>
|
||||
@ -135,7 +135,7 @@
|
||||
<class>QGroupBox</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>GroupBox1</cstring>
|
||||
<cstd::string>GroupBox1</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>frameShape</name>
|
||||
@ -147,7 +147,7 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>title</name>
|
||||
<string>Standards</string>
|
||||
<std::string>Standards</std::string>
|
||||
</property>
|
||||
<grid>
|
||||
<property stdset="1">
|
||||
@ -162,47 +162,47 @@
|
||||
<class>QLineEdit</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>descr</cstring>
|
||||
<cstd::string>descr</cstd::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="0" column="0" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel2</cstring>
|
||||
<cstd::string>TextLabel2</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Certificate name</string>
|
||||
<std::string>Certificate name</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="1" column="0" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel4</cstring>
|
||||
<cstd::string>TextLabel4</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Signature</string>
|
||||
<std::string>Signature</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="2" column="0" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel6</cstring>
|
||||
<cstd::string>TextLabel6</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Key</string>
|
||||
<std::string>Key</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="1" column="1" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>verify</cstring>
|
||||
<cstd::string>verify</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>palette</name>
|
||||
@ -441,7 +441,7 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>OK</string>
|
||||
<std::string>OK</std::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>alignment</name>
|
||||
@ -455,7 +455,7 @@
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>privKey</cstring>
|
||||
<cstd::string>privKey</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>enabled</name>
|
||||
@ -698,7 +698,7 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>not available</string>
|
||||
<std::string>not available</std::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>alignment</name>
|
||||
@ -714,11 +714,11 @@
|
||||
<class>QGroupBox</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>GroupBox3</cstring>
|
||||
<cstd::string>GroupBox3</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>title</name>
|
||||
<string>Subject</string>
|
||||
<std::string>Subject</std::string>
|
||||
</property>
|
||||
<grid>
|
||||
<property stdset="1">
|
||||
@ -733,62 +733,62 @@
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel6_2</cstring>
|
||||
<cstd::string>TextLabel6_2</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>name / DNS</string>
|
||||
<std::string>name / DNS</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="1" column="0" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel4_2</cstring>
|
||||
<cstd::string>TextLabel4_2</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Province</string>
|
||||
<std::string>Province</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="0" column="0" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel3</cstring>
|
||||
<cstd::string>TextLabel3</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Country</string>
|
||||
<std::string>Country</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="1" column="2" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel5</cstring>
|
||||
<cstd::string>TextLabel5</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Org. Unit</string>
|
||||
<std::string>Org. Unit</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="2" column="2" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel7_2</cstring>
|
||||
<cstd::string>TextLabel7_2</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>E-Mail</string>
|
||||
<std::string>E-Mail</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="0" column="1" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>dnC</cstring>
|
||||
<cstd::string>dnC</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>sizePolicy</name>
|
||||
@ -807,14 +807,14 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string></string>
|
||||
<std::string></std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="0" column="3" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>dnO</cstring>
|
||||
<cstd::string>dnO</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>sizePolicy</name>
|
||||
@ -833,14 +833,14 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string></string>
|
||||
<std::string></std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="1" column="3" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>dnOU</cstring>
|
||||
<cstd::string>dnOU</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>sizePolicy</name>
|
||||
@ -859,14 +859,14 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string></string>
|
||||
<std::string></std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="2" column="3" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>dnEmail</cstring>
|
||||
<cstd::string>dnEmail</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>sizePolicy</name>
|
||||
@ -885,14 +885,14 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string></string>
|
||||
<std::string></std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="2" column="1" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>dnCN</cstring>
|
||||
<cstd::string>dnCN</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>sizePolicy</name>
|
||||
@ -911,14 +911,14 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string></string>
|
||||
<std::string></std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="1" column="1" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>dnL</cstring>
|
||||
<cstd::string>dnL</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>sizePolicy</name>
|
||||
@ -937,18 +937,18 @@
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string></string>
|
||||
<std::string></std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="0" column="2" >
|
||||
<class>QLabel</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>TextLabel4_2_2</cstring>
|
||||
<cstd::string>TextLabel4_2_2</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Organisation</string>
|
||||
<std::string>Organisation</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
</grid>
|
||||
@ -957,7 +957,7 @@
|
||||
<class>QLayoutWidget</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>Layout18</cstring>
|
||||
<cstd::string>Layout18</cstd::string>
|
||||
</property>
|
||||
<hbox>
|
||||
<property stdset="1">
|
||||
@ -972,17 +972,17 @@
|
||||
<class>QPushButton</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>PushButton11</cstring>
|
||||
<cstd::string>PushButton11</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>Cancel</string>
|
||||
<std::string>Cancel</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property>
|
||||
<name>name</name>
|
||||
<cstring>Spacer6</cstring>
|
||||
<cstd::string>Spacer6</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>orientation</name>
|
||||
@ -1004,11 +1004,11 @@
|
||||
<class>QPushButton</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>PushButton10</cstring>
|
||||
<cstd::string>PushButton10</cstd::string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>OK</string>
|
||||
<std::string>OK</std::string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
|
||||
@ -101,15 +101,15 @@ void *db_base::getData(void *key, int length, int *dsize)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *db_base::getData(string key, int *dsize)
|
||||
void *db_base::getData(std::string key, int *dsize)
|
||||
{
|
||||
return getData((void *)key.c_str(), key.length()+ 1, dsize);
|
||||
}
|
||||
|
||||
|
||||
string db_base::getString(string key)
|
||||
std::string db_base::getString(std::string key)
|
||||
{
|
||||
string x = "";
|
||||
std::string x = "";
|
||||
int dsize;
|
||||
char *p = (char *)getData(key, &dsize);
|
||||
if (p == NULL) {
|
||||
@ -130,16 +130,16 @@ string db_base::getString(string key)
|
||||
}
|
||||
|
||||
|
||||
string db_base::getString(char *key)
|
||||
std::string db_base::getString(char *key)
|
||||
{
|
||||
string x = key;
|
||||
std::string x = key;
|
||||
return getString(x);
|
||||
}
|
||||
|
||||
|
||||
int db_base::getInt(string key)
|
||||
int db_base::getInt(std::string key)
|
||||
{
|
||||
string x = getString(key);
|
||||
std::string x = getString(key);
|
||||
return atoi(x.c_str());
|
||||
}
|
||||
|
||||
@ -158,13 +158,13 @@ void db_base::putData(void *key, int keylen, void *dat, int datalen)
|
||||
}
|
||||
}
|
||||
|
||||
void db_base::putString(string key, void *dat, int datalen)
|
||||
void db_base::putString(std::string key, void *dat, int datalen)
|
||||
{
|
||||
CERR( key );
|
||||
putData((void *)key.c_str(), key.length()+1, dat, datalen);
|
||||
}
|
||||
|
||||
void db_base::putString(string key, std::string dat)
|
||||
void db_base::putString(std::string key, std::string dat)
|
||||
{
|
||||
CERR( key);
|
||||
putString(key, (void *)dat.c_str(), dat.length() +1);
|
||||
@ -172,16 +172,16 @@ void db_base::putString(string key, std::string dat)
|
||||
|
||||
void db_base::putString(char *key, std::string dat)
|
||||
{
|
||||
string x = key;
|
||||
std::string x = key;
|
||||
CERR(key);
|
||||
putString(x,dat);
|
||||
}
|
||||
|
||||
void db_base::putInt(string key, int dat)
|
||||
void db_base::putInt(std::string key, int dat)
|
||||
{
|
||||
char buf[100];
|
||||
sprintf(buf,"%i",dat);
|
||||
string x = buf;
|
||||
std::string x = buf;
|
||||
putString(key, x);
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ void db_base::loadContainer()
|
||||
data->cursor(tid, &cursor, 0);
|
||||
Dbt *k = new Dbt();
|
||||
Dbt *d = new Dbt();
|
||||
string desc;
|
||||
std::string desc;
|
||||
pki_base *pki;
|
||||
container.clear();
|
||||
CERR("Load Container");
|
||||
@ -268,11 +268,11 @@ void db_base::_writePKI(pki_base *pki, bool overwrite, DbTxn *tid)
|
||||
{
|
||||
int flags = 0;
|
||||
if (!overwrite) flags = DB_NOOVERWRITE;
|
||||
string desc = pki->getDescription();
|
||||
std::string desc = pki->getDescription();
|
||||
if (desc == "") {
|
||||
desc="unnamed";
|
||||
}
|
||||
string orig = desc;
|
||||
std::string orig = desc;
|
||||
int size=0;
|
||||
char field[10];
|
||||
unsigned char *p;
|
||||
@ -294,7 +294,7 @@ void db_base::_writePKI(pki_base *pki, bool overwrite, DbTxn *tid)
|
||||
if ((x = data->put(tid, &k, &d, flags ))!=0) {
|
||||
data->err(x,"DB Error put");
|
||||
sprintf(field,"%02i", ++cnt);
|
||||
string z = field;
|
||||
std::string z = field;
|
||||
desc = orig + "_" + z ;
|
||||
}
|
||||
}
|
||||
@ -304,11 +304,11 @@ void db_base::_writePKI(pki_base *pki, bool overwrite, DbTxn *tid)
|
||||
|
||||
void db_base::_removePKI(pki_base *pki, DbTxn *tid)
|
||||
{
|
||||
string desc = pki->getDescription();
|
||||
std::string desc = pki->getDescription();
|
||||
removeItem(desc, tid);
|
||||
}
|
||||
|
||||
void db_base::removeItem(string key, DbTxn *tid)
|
||||
void db_base::removeItem(std::string key, DbTxn *tid)
|
||||
{
|
||||
Dbt k((void *)key.c_str(), key.length() + 1);
|
||||
data->del(tid, &k, 0);
|
||||
@ -335,7 +335,7 @@ void db_base::deletePKI(pki_base *pki)
|
||||
|
||||
void db_base::renamePKI(pki_base *pki, std::string desc)
|
||||
{
|
||||
string oldname = pki->getDescription();
|
||||
std::string oldname = pki->getDescription();
|
||||
DbTxn *tid = NULL;
|
||||
try {
|
||||
dbenv->txn_begin(NULL, &tid, 0);
|
||||
@ -388,7 +388,7 @@ void db_base::updatePKI(pki_base *pki)
|
||||
}
|
||||
|
||||
|
||||
pki_base *db_base::getSelectedPKI(string desc)
|
||||
pki_base *db_base::getSelectedPKI(std::string desc)
|
||||
{
|
||||
if (desc == "" ) return NULL;
|
||||
CERR("desc = '" << desc << "'");
|
||||
@ -418,7 +418,7 @@ pki_base *db_base::getSelectedPKI(void *item)
|
||||
pki_base *db_base::getSelectedPKI()
|
||||
{
|
||||
const char *tp;
|
||||
string desc = "";
|
||||
std::string desc = "";
|
||||
QListViewItem *lvi;
|
||||
if ((lvi = listView->selectedItem()) == NULL) return NULL;
|
||||
if ((tp = lvi->text(0).latin1())) desc = tp;
|
||||
|
||||
@ -92,7 +92,7 @@ class db_base: public QObject
|
||||
QList<pki_base> container;
|
||||
void _writePKI(pki_base *pki, bool overwrite, DbTxn *tid );
|
||||
void _removePKI(pki_base *pki, DbTxn *tid );
|
||||
void removeItem(string k, DbTxn *tid);
|
||||
void removeItem(std::string k, DbTxn *tid);
|
||||
public:
|
||||
db_base(DbEnv *dbe, std::string DBfile, std::string db);
|
||||
virtual ~db_base();
|
||||
@ -105,7 +105,7 @@ class db_base: public QObject
|
||||
virtual void updatePKI(pki_base *pki);
|
||||
virtual void renamePKI(pki_base *pki, std::string desc);
|
||||
pki_base *getSelectedPKI(void *item);
|
||||
pki_base *getSelectedPKI(string desc);
|
||||
pki_base *getSelectedPKI(std::string desc);
|
||||
pki_base *getSelectedPKI();
|
||||
pki_base *findPKI(pki_base *refpki);
|
||||
virtual void loadContainer();
|
||||
@ -116,15 +116,15 @@ class db_base: public QObject
|
||||
virtual void remFromCont(pki_base *pki);
|
||||
virtual void inToCont(pki_base *pki);
|
||||
void *getData(void* key, int length, int *dsize);
|
||||
void *getData(string key, int *dsize);
|
||||
string getString(string key);
|
||||
string getString(char *key);
|
||||
int getInt(string key);
|
||||
void *getData(std::string key, int *dsize);
|
||||
std::string getString(std::string key);
|
||||
std::string getString(char *key);
|
||||
int getInt(std::string key);
|
||||
void putData(void *key, int keylen, void *dat, int datalen);
|
||||
void putString(string key, void *dat, int datalen);
|
||||
void putString(string key, std::string dat);
|
||||
void putString(std::string key, void *dat, int datalen);
|
||||
void putString(std::string key, std::string dat);
|
||||
void putString(char *key, std::string dat);
|
||||
void putInt(string key, int dat);
|
||||
void putInt(std::string key, int dat);
|
||||
QPixmap *loadImg(const char *name);
|
||||
void setSelected(pki_base *item);
|
||||
};
|
||||
|
||||
@ -72,21 +72,21 @@ pki_base::~pki_base(void)
|
||||
{}
|
||||
|
||||
|
||||
string pki_base::getDescription()
|
||||
std::string pki_base::getDescription()
|
||||
{
|
||||
string x = desc;
|
||||
std::string x = desc;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
string pki_base::getError()
|
||||
std::string pki_base::getError()
|
||||
{
|
||||
string x = error;
|
||||
std::string x = error;
|
||||
error = "";
|
||||
return x;
|
||||
}
|
||||
|
||||
string pki_base::getClassName()
|
||||
std::string pki_base::getClassName()
|
||||
{
|
||||
return className;
|
||||
}
|
||||
@ -101,14 +101,14 @@ void pki_base::setDescription(const std::string d)
|
||||
|
||||
void pki_base::fopen_error(const std::string fname)
|
||||
{
|
||||
string txt = "Error opening file: '" + fname + "'";
|
||||
std::string txt = "Error opening file: '" + fname + "'";
|
||||
openssl_error(txt);
|
||||
}
|
||||
|
||||
|
||||
void pki_base::openssl_error(const std::string myerr)
|
||||
{
|
||||
string errtxt = "";
|
||||
std::string errtxt = "";
|
||||
error = "";
|
||||
if (myerr != "") {
|
||||
CERR("PKI ERROR: " << myerr);
|
||||
@ -128,7 +128,7 @@ void pki_base::openssl_error(const std::string myerr)
|
||||
bool pki_base::ign_openssl_error()
|
||||
{
|
||||
// ignore openssl errors
|
||||
string errtxt;
|
||||
std::string errtxt;
|
||||
while (int i = ERR_get_error() ) {
|
||||
errtxt = ERR_error_string(i ,NULL);
|
||||
CERR("IGNORE -> OpenSSL: " << errtxt << " <- IGNORE");
|
||||
@ -178,9 +178,9 @@ int pki_base::stringToData(unsigned char **p, const std::string val)
|
||||
return s;
|
||||
}
|
||||
|
||||
string pki_base::stringFromData(unsigned char **p)
|
||||
std::string pki_base::stringFromData(unsigned char **p)
|
||||
{
|
||||
string ret="";
|
||||
std::string ret="";
|
||||
while(**p) {
|
||||
ret +=(char)**p;
|
||||
*p += sizeof(char);
|
||||
|
||||
@ -56,17 +56,17 @@
|
||||
#define PKI_BASE_H
|
||||
|
||||
struct PASS_INFO {
|
||||
string *title;
|
||||
string *description;
|
||||
std::string *title;
|
||||
std::string *description;
|
||||
};
|
||||
|
||||
|
||||
class pki_base
|
||||
{
|
||||
protected:
|
||||
string desc;
|
||||
string error;
|
||||
string className;
|
||||
std::string desc;
|
||||
std::string error;
|
||||
std::string className;
|
||||
void *pointer;
|
||||
void openssl_error(const std::string myerr = "");
|
||||
void fopen_error(const std::string fname);
|
||||
|
||||
@ -107,7 +107,7 @@ void pki_crl::addV3ext(int nid, std::string exttext)
|
||||
ext = X509V3_EXT_conf_nid(NULL, &ctx, nid, c);
|
||||
OPENSSL_free(c);
|
||||
if (!ext) {
|
||||
string x="CRL v3 Extension: " + exttext;
|
||||
std::string x="CRL v3 Extension: " + exttext;
|
||||
openssl_error(x);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ class pki_crl: public pki_base
|
||||
|
||||
void addRevoked(const pki_x509 *rev);
|
||||
void addExt(int nid, std::string value);
|
||||
void write(string fname);
|
||||
void write(std::string fname);
|
||||
void addV3ext(int nid, std::string exttext);
|
||||
void sign(pki_key *key);
|
||||
void writeCrl(const std::string fname);
|
||||
|
||||
@ -108,8 +108,8 @@ pki_key::pki_key(const std::string fname, pem_password_cb *cb, int type )
|
||||
{
|
||||
init();
|
||||
PASS_INFO p;
|
||||
string title = XCA_TITLE;
|
||||
string description = "Please enter the password to decrypt the RSA key.";
|
||||
std::string title = XCA_TITLE;
|
||||
std::string description = "Please enter the password to decrypt the RSA key.";
|
||||
p.title = &title;
|
||||
p.description = &description;
|
||||
key = EVP_PKEY_new();
|
||||
@ -287,8 +287,8 @@ pki_key::~pki_key()
|
||||
void pki_key::writePKCS8(const std::string fname, pem_password_cb *cb)
|
||||
{
|
||||
PASS_INFO p;
|
||||
string title=XCA_TITLE;
|
||||
string description="Please enter the password protecting the PKCS#8 key";
|
||||
std::string title=XCA_TITLE;
|
||||
std::string description="Please enter the password protecting the PKCS#8 key";
|
||||
p.title = &title;
|
||||
p.description = &description;
|
||||
FILE *fp = fopen(fname.c_str(),"w");
|
||||
@ -308,8 +308,8 @@ void pki_key::writeKey(const std::string fname, EVP_CIPHER *enc,
|
||||
pem_password_cb *cb, bool PEM)
|
||||
{
|
||||
PASS_INFO p;
|
||||
string title=XCA_TITLE;
|
||||
string description="Please enter the password protecting the RSA private key";
|
||||
std::string title=XCA_TITLE;
|
||||
std::string description="Please enter the password protecting the RSA private key";
|
||||
p.title = &title;
|
||||
p.description = &description;
|
||||
if (isPubKey()) {
|
||||
@ -351,19 +351,19 @@ void pki_key::writePublic(const std::string fname, bool PEM)
|
||||
}
|
||||
|
||||
|
||||
string pki_key::length()
|
||||
std::string pki_key::length()
|
||||
{
|
||||
char st[64];
|
||||
sprintf(st,"%i bit", EVP_PKEY_size(key) * 8 );
|
||||
openssl_error();
|
||||
string x = st;
|
||||
std::string x = st;
|
||||
return x;
|
||||
}
|
||||
|
||||
string pki_key::BN2string(BIGNUM *bn)
|
||||
std::string pki_key::BN2string(BIGNUM *bn)
|
||||
{
|
||||
if (bn == NULL) return "--";
|
||||
string x="";
|
||||
std::string x="";
|
||||
char zs[10];
|
||||
int j;
|
||||
int size = BN_num_bytes(bn);
|
||||
@ -378,15 +378,15 @@ string pki_key::BN2string(BIGNUM *bn)
|
||||
return x;
|
||||
}
|
||||
|
||||
string pki_key::modulus() {
|
||||
std::string pki_key::modulus() {
|
||||
return BN2string(key->pkey.rsa->n);
|
||||
}
|
||||
|
||||
string pki_key::pubEx() {
|
||||
std::string pki_key::pubEx() {
|
||||
return BN2string(key->pkey.rsa->e);
|
||||
}
|
||||
|
||||
string pki_key::privEx() {
|
||||
std::string pki_key::privEx() {
|
||||
if (isPubKey()) return "Not existent (not a private key)";
|
||||
return BN2string(key->pkey.rsa->d);
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ class pki_key: public pki_base
|
||||
friend class pki_crl;
|
||||
protected:
|
||||
EVP_PKEY *key;
|
||||
string BN2string(BIGNUM *bn);
|
||||
std::string BN2string(BIGNUM *bn);
|
||||
int ucount; // usage counter
|
||||
public:
|
||||
static char passwd[40];
|
||||
|
||||
@ -75,8 +75,8 @@ pki_pkcs12::pki_pkcs12(const std::string fname, pem_password_cb *cb)
|
||||
passcb = cb;
|
||||
certstack = sk_X509_new_null();
|
||||
PASS_INFO p;
|
||||
string title = XCA_TITLE;
|
||||
string description = "Please enter the password to encrypt the PKCS#12 file.";
|
||||
std::string title = XCA_TITLE;
|
||||
std::string description = "Please enter the password to encrypt the PKCS#12 file.";
|
||||
p.title = &title;
|
||||
p.description = &description;
|
||||
fp = fopen(fname.c_str(), "rb");
|
||||
@ -134,8 +134,8 @@ void pki_pkcs12::writePKCS12(const std::string fname)
|
||||
char desc[100];
|
||||
strncpy(desc,getDescription().c_str(),100);
|
||||
PASS_INFO p;
|
||||
string title = XCA_TITLE;
|
||||
string description = "Please enter the password to encrypt the PKCS#12 file";
|
||||
std::string title = XCA_TITLE;
|
||||
std::string description = "Please enter the password to encrypt the PKCS#12 file";
|
||||
p.title = &title;
|
||||
p.description = &description;
|
||||
if (!pkcs12) {
|
||||
|
||||
@ -108,7 +108,7 @@ void pki_pkcs7::signCert(pki_x509 *crt, pki_x509 *contCert)
|
||||
BIO_free(bio);
|
||||
}
|
||||
|
||||
void pki_pkcs7::writeP7(string fname,bool PEM)
|
||||
void pki_pkcs7::writeP7(std::string fname,bool PEM)
|
||||
{
|
||||
FILE *fp;
|
||||
fp = fopen(fname.c_str(),"w");
|
||||
|
||||
@ -71,8 +71,8 @@ class pki_pkcs7: public pki_base
|
||||
void signFile(pki_x509 *crt, std::string filename);
|
||||
void signCert(pki_x509 *crt, pki_x509 *contCert);
|
||||
//void encryptFile(pki_x509 *crt, std::string filename);
|
||||
void writeP7(string fname,bool PEM);
|
||||
//void readP7(string fname);
|
||||
void writeP7(std::string fname,bool PEM);
|
||||
//void readP7(std::string fname);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -68,9 +68,9 @@ class pki_temp: public pki_base
|
||||
int version;
|
||||
|
||||
public:
|
||||
string C,P,L,O,OU,CN,EMAIL;
|
||||
string subAltName, issAltName, crlDist;
|
||||
string nsComment, nsBaseUrl, nsRevocationUrl, nsCARevocationUrl, nsRenewalUrl, nsCaPolicyUrl, nsSslServerName;
|
||||
std::string C,P,L,O,OU,CN,EMAIL;
|
||||
std::string subAltName, issAltName, crlDist;
|
||||
std::string nsComment, nsBaseUrl, nsRevocationUrl, nsCARevocationUrl, nsRenewalUrl, nsCaPolicyUrl, nsSslServerName;
|
||||
bool ca, bcCrit, keyUseCrit, eKeyUseCrit, subKey, authKey, subAltCp, issAltCp ;
|
||||
int type, nsCertType, pathLen, validN, validM, keyUse, eKeyUse;
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@
|
||||
#include "pki_x509.h"
|
||||
|
||||
|
||||
pki_x509::pki_x509(string d,pki_key *clientKey, pki_x509req *req, pki_x509 *signer, int days, int serial)
|
||||
pki_x509::pki_x509(std::string d,pki_key *clientKey, pki_x509req *req, pki_x509 *signer, int days, int serial)
|
||||
:pki_base( d )
|
||||
{
|
||||
init();
|
||||
@ -214,7 +214,7 @@ void pki_x509::addV3ext(int nid, std::string exttext)
|
||||
ext = X509V3_EXT_conf_nid(NULL, &ext_ctx, nid, c);
|
||||
OPENSSL_free(c);
|
||||
if (!ext) {
|
||||
string x="v3 Extension: " + exttext;
|
||||
std::string x="v3 Extension: " + exttext;
|
||||
openssl_error(x);
|
||||
return;
|
||||
}
|
||||
@ -359,10 +359,10 @@ unsigned char *pki_x509::toData(int *size)
|
||||
}
|
||||
|
||||
|
||||
string pki_x509::getDNs(int nid)
|
||||
std::string pki_x509::getDNs(int nid)
|
||||
{
|
||||
char buf[200] = "";
|
||||
string s;
|
||||
std::string s;
|
||||
X509_NAME *subj = X509_get_subject_name(cert);
|
||||
X509_NAME_get_text_by_NID(subj, nid, buf, 200);
|
||||
openssl_error();
|
||||
@ -370,10 +370,10 @@ string pki_x509::getDNs(int nid)
|
||||
return s;
|
||||
}
|
||||
|
||||
string pki_x509::getDNi(int nid)
|
||||
std::string pki_x509::getDNi(int nid)
|
||||
{
|
||||
char buf[200] = "";
|
||||
string s;
|
||||
std::string s;
|
||||
X509_NAME *iss = X509_get_issuer_name(cert);
|
||||
X509_NAME_get_text_by_NID(iss, nid, buf, 200);
|
||||
openssl_error();
|
||||
@ -381,26 +381,26 @@ string pki_x509::getDNi(int nid)
|
||||
return s;
|
||||
}
|
||||
|
||||
string pki_x509::notBefore()
|
||||
std::string pki_x509::notBefore()
|
||||
{
|
||||
return asn1TimeToString(X509_get_notBefore(cert));
|
||||
}
|
||||
|
||||
|
||||
string pki_x509::notAfter()
|
||||
std::string pki_x509::notAfter()
|
||||
{
|
||||
return asn1TimeToString(X509_get_notAfter(cert));
|
||||
}
|
||||
|
||||
string pki_x509::revokedAt()
|
||||
std::string pki_x509::revokedAt()
|
||||
{
|
||||
return asn1TimeToString(revoked);
|
||||
}
|
||||
|
||||
|
||||
string pki_x509::asn1TimeToString(ASN1_TIME *a)
|
||||
std::string pki_x509::asn1TimeToString(ASN1_TIME *a)
|
||||
{
|
||||
string time = "";
|
||||
std::string time = "";
|
||||
if (!a) return time;
|
||||
BIO * bio = BIO_new(BIO_s_mem());
|
||||
char buf[200];
|
||||
@ -484,7 +484,7 @@ pki_key *pki_x509::getPubKey()
|
||||
|
||||
|
||||
|
||||
string pki_x509::fingerprint(EVP_MD *digest)
|
||||
std::string pki_x509::fingerprint(EVP_MD *digest)
|
||||
{
|
||||
int j;
|
||||
std::string fp="";
|
||||
@ -556,7 +556,7 @@ void pki_x509::delKey() { pkey = NULL; }
|
||||
|
||||
void pki_x509::delSigner() { psigner=NULL; }
|
||||
|
||||
string pki_x509::printV3ext()
|
||||
std::string pki_x509::printV3ext()
|
||||
{
|
||||
#define V3_BUF 100
|
||||
ASN1_OBJECT *obj;
|
||||
@ -564,7 +564,7 @@ string pki_x509::printV3ext()
|
||||
int i, len, n = X509_get_ext_count(cert);
|
||||
char buffer[V3_BUF+1];
|
||||
X509_EXTENSION *ex;
|
||||
string text="";
|
||||
std::string text="";
|
||||
for (i=0; i<n; i++) {
|
||||
text += "<b><u>";
|
||||
ex = X509_get_ext(cert,i);
|
||||
@ -595,14 +595,14 @@ string pki_x509::printV3ext()
|
||||
return text;
|
||||
}
|
||||
|
||||
string pki_x509::getSerial()
|
||||
std::string pki_x509::getSerial()
|
||||
{
|
||||
char buf[100];
|
||||
BIO *bio = BIO_new(BIO_s_mem());
|
||||
i2a_ASN1_INTEGER(bio, cert->cert_info->serialNumber);
|
||||
int len = BIO_read(bio, buf, 100);
|
||||
buf[len]='\0';
|
||||
string x = buf;
|
||||
std::string x = buf;
|
||||
BIO_free(bio);
|
||||
openssl_error();
|
||||
return x;
|
||||
@ -691,9 +691,9 @@ int pki_x509::getCrlDays() {return crlDays;}
|
||||
|
||||
void pki_x509::setCrlDays(int s){if (s>0) crlDays = s;}
|
||||
|
||||
string pki_x509::getTemplate(){ return caTemplate; }
|
||||
std::string pki_x509::getTemplate(){ return caTemplate; }
|
||||
|
||||
void pki_x509::setTemplate(string s) {if (s.length()>0) caTemplate = s; }
|
||||
void pki_x509::setTemplate(std::string s) {if (s.length()>0) caTemplate = s; }
|
||||
|
||||
void pki_x509::setLastCrl(ASN1_TIME *time)
|
||||
{
|
||||
|
||||
@ -75,7 +75,7 @@ class pki_x509 : public pki_base
|
||||
X509 *cert;
|
||||
void init();
|
||||
public:
|
||||
pki_x509(string d, pki_key *clientKey, pki_x509req *req, pki_x509 *signer, int days, int serial);
|
||||
pki_x509(std::string d, pki_key *clientKey, pki_x509req *req, pki_x509 *signer, int days, int serial);
|
||||
pki_x509(X509 *c);
|
||||
pki_x509(const pki_x509 *crt);
|
||||
pki_x509();
|
||||
@ -116,7 +116,7 @@ class pki_x509 : public pki_base
|
||||
int getIncCaSerial();
|
||||
int getCaSerial();
|
||||
void setCaSerial(int s);
|
||||
void setTemplate(string s);
|
||||
void setTemplate(std::string s);
|
||||
std::string getTemplate();
|
||||
void setCrlDays(int s);
|
||||
int getCrlDays();
|
||||
|
||||
@ -180,10 +180,10 @@ void pki_x509req::fromData(unsigned char *p, int size)
|
||||
}
|
||||
|
||||
|
||||
string pki_x509req::getDN(int nid)
|
||||
std::string pki_x509req::getDN(int nid)
|
||||
{
|
||||
char buf[200] = "";
|
||||
string s;
|
||||
std::string s;
|
||||
X509_NAME *subj = X509_REQ_get_subject_name(request);
|
||||
X509_NAME_get_text_by_NID(subj, nid, buf, 200);
|
||||
openssl_error();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user