diff --git a/CertExtend.ui b/CertExtend.ui
index 871118e3..9c576f0f 100644
--- a/CertExtend.ui
+++ b/CertExtend.ui
@@ -11,8 +11,8 @@
0
0
- 388
- 284
+ 335
+ 336
@@ -145,68 +145,11 @@
- QGroupBox
+ Validity
name
- GroupBox3
+ validity
-
- title
- Validity
-
-
-
- margin
- 11
-
-
- spacing
- 6
-
-
- QLineEdit
-
- name
- validNumber
-
-
- sizePolicy
-
- 5
- 0
-
-
-
- text
- 365
-
-
-
- QComboBox
- -
-
- text
- Days
-
-
- -
-
- text
- Months
-
-
- -
-
- text
- Years
-
-
-
- name
- validRange
-
-
-
@@ -286,6 +229,11 @@
name
PushButton2
+
+ font
+
+
+
text
&OK
@@ -295,6 +243,28 @@
+
+
+ Validity
+
+
+ -1
+ -1
+
+ 1
+
+ 7
+ 7
+
+ image0
+
+
+
+
+ image0
+ 789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753
+
+
PushButton3
diff --git a/CertView.cpp b/CertView.cpp
index 928f4298..c4fe016a 100644
--- a/CertView.cpp
+++ b/CertView.cpp
@@ -57,8 +57,12 @@
#include
#include
#include
+#include
+#include
#include "CertExtend.h"
#include "CertDetail.h"
+#include "validity.h"
+#include "lib/pki_pkcs12.h"
CertView::CertView(QWidget * parent = 0, const char * name = 0, WFlags f = 0)
:XcaListView(parent, name, f)
@@ -149,8 +153,8 @@ void CertView::newCert(NewX509 *dlg)
// Step 3 - Choose the Date and all the V3 extensions
// Date handling
- notBefore = dlg->getNotBefore();
- notAfter = dlg->getNotAfter();
+ notBefore = dlg->validity->getNotBefore();
+ notAfter = dlg->validity->getNotAfter();
// initially create cert
cert = new pki_x509();
@@ -318,11 +322,14 @@ void CertView::extendCert()
{
pki_x509 *oldcert = NULL, *signer = NULL, *newcert =NULL;
pki_key *signkey = NULL;
- int days, x;
+ a1time time;
a1int serial;
try {
CertExtend_UI *dlg = new CertExtend_UI(this, NULL, true);
dlg->image->setPixmap(*MainWindow::certImg);
+ dlg->validity->setNotBefore(time.now());
+ dlg->validity->setNotAfter(time.now(60 * 60 * 24 * 356));
+
if (!dlg->exec()) {
delete dlg;
return;
@@ -338,16 +345,10 @@ void CertView::extendCert()
}
db->updatePKI(signer); // FIXME::not so pretty ....
- // Date handling
- x = dlg->validNumber->text().toInt();
- days = dlg->validRange->currentItem();
- if (days == 1) x *= 30;
- if (days == 2) x *= 365;
-
// change date and serial
newcert->setSerial(serial);
- newcert->setNotBefore(dlg->getNotBefore());
- newcert->setNotAfter(dlg->getNotAfter());
+ newcert->setNotBefore(dlg->validity->getNotBefore());
+ newcert->setNotAfter(dlg->validity->getNotAfter());
if (newcert->resetTimes(signer) > 0) {
if (QMessageBox::information(this,tr(XCA_TITLE),
@@ -376,16 +377,16 @@ void CertView::show(pki_base *basecert, bool import)
{
pki_x509 *cert = (pki_x509 *)basecert;
if (!cert) return;
- if (opensslError(cert)) return ;
+ if (Error(cert)) return ;
try {
CertDetail_UI *dlg = new CertDetail_UI(this,0,true);
bool ret;
- dlg->image->setPixmap(*certImg);
+ dlg->image->setPixmap(*MainWindow::certImg);
dlg->descr->setText(cert->getIntName());
dlg->setCaption(tr(XCA_TITLE));
// examine the key
- pki_key *key= cert->getKey();
+ pki_key *key= cert->getRefKey();
if (key)
if (key->isPrivKey()) {
dlg->privKey->setText(key->getIntName());
@@ -422,7 +423,7 @@ void CertView::show(pki_base *basecert, bool import)
else
land+=land1;
- dlg->dnCN->setText(subj.geEntryByNid(NID_commonName));
+ dlg->dnCN->setText(subj.getEntryByNid(NID_commonName));
dlg->dnC->setText(land);
dlg->dnL->setText(subj.getEntryByNid(NID_localityName));
dlg->dnO->setText(subj.getEntryByNid(NID_organizationName));
@@ -444,8 +445,8 @@ void CertView::show(pki_base *basecert, bool import)
dlg->dnO_2->setText(iss.getEntryByNid(NID_organizationName));
dlg->dnOU_2->setText(iss.getEntryByNid(NID_organizationalUnitName));
dlg->dnEmail_2->setText(iss.getEntryByNid(NID_pkcs9_emailAddress));
- dlg->notBefore->setText(cert.getNotBefore().toPretty());
- dlg->notAfter->setText(cert.getNotAfter().toPretty());
+ dlg->notBefore->setText(cert->getNotBefore().toPretty());
+ dlg->notAfter->setText(cert->getNotAfter().toPretty());
MARK
// validation of the Date
@@ -490,7 +491,7 @@ void CertView::show(pki_base *basecert, bool import)
init_database();
}
if (import) {
- cert = insert(cert);
+ cert = (pki_x509 *)insert(cert);
}
if (ndesc != odesc) {
db->renamePKI(cert, ndesc);
@@ -521,7 +522,7 @@ void CertView::deleteItem()
}
}
-void CertView::loadItem()
+void CertView::load()
{
QStringList filter;
filter.append(tr("Certificates ( *.pem *.der *.crt *.cer )"));
@@ -529,9 +530,9 @@ void CertView::loadItem()
load_default(filter,tr("Certificate import"));
}
-void CertView::loadItem(QString fname)
+pki_base *CertView::loadItem(QString fname)
{
- pki_x509 *cert = new pki_x509(s);
+ pki_x509 *cert = new pki_x509(fname);
return cert;
}
@@ -547,17 +548,17 @@ void CertView::loadPKCS12()
dlg->setCaption(tr("Certificate import"));
dlg->setFilters(filt);
dlg->setMode( QFileDialog::ExistingFiles );
- setPath(dlg);
+ dlg->setDir(MainWindow::getPath());
if (dlg->exec()) {
slist = dlg->selectedFiles();
- newPath(dlg);
+ MainWindow::setPath(dlg->dirPath());
}
delete dlg;
for ( QStringList::Iterator it = slist.begin(); it != slist.end(); ++it ) {
s = *it;
s = QDir::convertSeparators(s);
try {
- pk12 = new pki_pkcs12(s, &CertView::passRead);
+ pk12 = new pki_pkcs12(s, &MainWindow::passRead);
insertP12(pk12);
MARK
}
@@ -624,10 +625,10 @@ void CertView::loadPKCS7()
dlg->setCaption(tr("Certificate import"));
dlg->setFilters(filt);
dlg->setMode( QFileDialog::ExistingFiles );
- setPath(dlg);
+ dlg->setDir(MainWindow::getPath());
if (dlg->exec()) {
slist = dlg->selectedFiles();
- newPath(dlg);
+ MainWindow::setPath(dlg->dirPath());
}
delete dlg;
for ( QStringList::Iterator it = slist.begin(); it != slist.end(); ++it ) {
@@ -700,7 +701,7 @@ pki_x509 *CertView::insert(pki_base *item)
#define P7_CHAIN 1
#define P7_TRUSTED 2
-void CertView::writeCert()
+void CertView::store()
{
QStringList filt;
pki_x509 *crt = (pki_x509 *)certs->getSelectedPKI();
diff --git a/CertView.h b/CertView.h
index d40e00c1..95674805 100644
--- a/CertView.h
+++ b/CertView.h
@@ -44,7 +44,7 @@
* http://www.hohnstaedt.de/xca
* email: christian@hohnstaedt.de
*
- * $Id$
+ * $Id$
*
*/
@@ -54,6 +54,7 @@
#include "XcaListView.h"
#include "lib/pki_x509.h"
+#include "lib/pki_pkcs12.h"
#include
#include "NewX509.h"
@@ -69,9 +70,9 @@ class CertView : public XcaListView
void show(pki_base *item, bool import);
void newItem();
void deleteItem();
- void load();
void updateViewItem(pki_base *);
- pki_base *loadItem(QString fname);
+ void load();
+ pki_base* loadItem(QString fname);
pki_base* insert(pki_base *item);
void store();
void popupMenu(QListViewItem *item, const QPoint &pt, int x);
@@ -79,6 +80,9 @@ class CertView : public XcaListView
void newCert(NewX509 *dlg);
void addStr(QString &str, const char *add);
void extendCert();
+ void loadPKCS12();
+ void insertP12(pki_pkcs12 *pk12);
+ void loadPKCS7();
signals:
void init_database();
diff --git a/NewX509.cpp b/NewX509.cpp
index 707419f9..63d117cc 100644
--- a/NewX509.cpp
+++ b/NewX509.cpp
@@ -539,16 +539,3 @@ x509name NewX509::getX509name()
return x;
}
-a1time NewX509::getNotBefore()
-{
- a1time nb;
- nb.set(nbYear->getText() + nbMon->getText() + nbDay->getText());
- return nb;
-}
-
-a1time NewX509::getNotAfter()
-{
- a1time nb;
- nb.set(nbYear->getText() + nbMon->getText() + nbDay->getText());
- return nb;
-}
diff --git a/NewX509.h b/NewX509.h
index 19cc2f6e..1a3109a3 100644
--- a/NewX509.h
+++ b/NewX509.h
@@ -90,8 +90,6 @@ class NewX509: public NewX509_UI
void templateChanged(QString templatename);
pki_key *getSelectedKey();
x509name getX509name();
- a1time getNotBefore();
- a1time getNotAfter();
public slots:
void toggleFromRequest();
void newKey();
diff --git a/NewX509_UI.ui b/NewX509_UI.ui
index 8e8a3cfe..0e6496fd 100644
--- a/NewX509_UI.ui
+++ b/NewX509_UI.ui
@@ -11,7 +11,7 @@
0
0
- 648
+ 644
542
@@ -1423,264 +1423,11 @@ It also copies the issuer and serial number from the issuer certificate. Normall
- QGroupBox
+ Validity
name
- GroupBox3
+ validity
-
- title
- Validity
-
-
- toolTip
- Number of validity
-
-
- whatsThis
- The validation time period is counted from "now" of your system clock the amount of time entered here.
-It is not possible to adjust the starting time of a certificate. This is a weakness of this program based on the laziness of the programmer and not a weakness of certificates or OpenSSL.
-
-
-
- margin
- 11
-
-
- spacing
- 6
-
-
- QLabel
-
- name
- TextLabel1_2
-
-
- text
- not Before
-
-
-
- QComboBox
-
- name
- nbDay
-
-
-
- QComboBox
- -
-
- text
- Jan
-
-
- -
-
- text
- Feb
-
-
- -
-
- text
- Mar
-
-
- -
-
- text
- Apr
-
-
- -
-
- text
- Mai
-
-
- -
-
- text
- Jun
-
-
- -
-
- text
- Jul
-
-
- -
-
- text
- Aug
-
-
- -
-
- text
- Sep
-
-
- -
-
- text
- Okt
-
-
- -
-
- text
- Nov
-
-
- -
-
- text
- Dec
-
-
-
- name
- nbMon
-
-
-
- QLineEdit
-
- name
- nbYear
-
-
- sizePolicy
-
- 5
- 0
-
-
-
- text
- 2003
-
-
-
- QComboBox
- -
-
- text
- Jan
-
-
- -
-
- text
- Feb
-
-
- -
-
- text
- Mar
-
-
- -
-
- text
- Apr
-
-
- -
-
- text
- Mai
-
-
- -
-
- text
- Jun
-
-
- -
-
- text
- Jul
-
-
- -
-
- text
- Aug
-
-
- -
-
- text
- Sep
-
-
- -
-
- text
- Okt
-
-
- -
-
- text
- Nov
-
-
- -
-
- text
- Dec
-
-
-
- name
- naMon
-
-
-
- QLineEdit
-
- name
- naYear
-
-
- sizePolicy
-
- 5
- 0
-
-
-
- text
- 2003
-
-
-
- QLabel
-
- name
- TextLabel2_4
-
-
- text
- not After
-
-
-
- QComboBox
-
- name
- naDay
-
-
-
@@ -2751,6 +2498,28 @@ URI:http://www.my.com/my.crl, URI:http://www.oth.com/my.crl
+
+
+ Validity
+
+
+ -1
+ -1
+
+ 1
+
+ 7
+ 7
+
+ image0
+
+
+
+
+ image0
+ 789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753
+
+
genKeyBUT
@@ -2850,8 +2619,6 @@ URI:http://www.my.com/my.crl, URI:http://www.oth.com/my.crl
basicPath
subKey
authKey
- nbYear
- nbMon
subAltName
subAltCp
issAltName
diff --git a/lib/asn1time.cpp b/lib/asn1time.cpp
index 1aa04bde..6f53d1c0 100644
--- a/lib/asn1time.cpp
+++ b/lib/asn1time.cpp
@@ -50,6 +50,7 @@
#include "asn1time.h"
#include
+#include
a1time::a1time()
{
@@ -68,15 +69,31 @@ a1time::~a1time()
ASN1_TIME_free(time);
}
-void a1time::set(const ASN1_TIME *a)
+a1time &a1time::set(const ASN1_TIME *a)
{
ASN1_TIME_free(time);
time = ASN1_TIME_to_generalizedtime((ASN1_TIME *)a, NULL);
+ return *this;
}
-void a1time::set(time_t t)
+a1time &a1time::set(time_t t)
{
ASN1_GENERALIZEDTIME_set(time, t);
+ return *this;
+}
+
+a1time &a1time::set(int y, int mon, int d, int h, int m, int s)
+{
+ if (time->length < 16 ||
+ mon < 1 || mon > 12 ||
+ d < 1 || d > 31 ||
+ h < 0 || h >23 ||
+ m < 0 || m > 59 ||
+ s < 0 || s > 59 )
+ ASN1err(ASN1_F_D2I_ASN1_GENERALIZEDTIME,ASN1_R_INVALID_TIME_FORMAT);
+
+ sprintf((char *)time->data, "%04d%02d%02d%02d%02d%02dZ", y, mon, d, h, m ,s);
+ return *this;
}
@@ -118,9 +135,10 @@ QString a1time::toSortable() const
return t;
}
-void a1time::set(const QString &s)
+a1time &a1time::set(const QString &s)
{
ASN1_GENERALIZEDTIME_set_string(time, (char *)s.latin1());
+ return *this;
}
int a1time::ymdg(int *y, int *m, int *d, int *g) const
@@ -144,14 +162,16 @@ int a1time::ymdg(int *y, int *m, int *d, int *g) const
return 0;
}
-void a1time::now(int delta)
+a1time &a1time::now(int delta)
{
X509_gmtime_adj(time, delta);
+ return *this;
}
-void a1time::operator = (const a1time &a)
+a1time &a1time::operator = (const a1time &a)
{
set(a.time);
+ return *this;
}
bool const a1time::operator > (const a1time &a)
diff --git a/lib/asn1time.h b/lib/asn1time.h
index 3948c4de..5d17ab44 100644
--- a/lib/asn1time.h
+++ b/lib/asn1time.h
@@ -65,18 +65,19 @@ class a1time
a1time();
a1time(const ASN1_TIME *a);
~a1time();
- void set(const ASN1_TIME *a);
- void set(time_t t);
- void set(const QString &s);
+ a1time &set(const ASN1_TIME *a);
+ a1time &set(time_t t);
+ a1time &set(const QString &s);
+ a1time &set(int y, int mon, int d, int h, int m, int s);
QString toPretty() const;
QString toPlain() const;
QString toSortable() const;
int ymdg(int *y, int *m, int *d, int *g) const;
ASN1_TIME *get() const;
- void now(int delta = 0);
+ a1time &now(int delta = 0);
unsigned char *i2d(unsigned char *p);
int derSize() const;
- void operator = (const a1time &a);
+ a1time &operator = (const a1time &a);
bool const operator > (const a1time &a);
bool const operator < (const a1time &a);
bool const operator == (const a1time &a);
diff --git a/lib/pki_base.h b/lib/pki_base.h
index 7081f9e1..a68a8dc1 100644
--- a/lib/pki_base.h
+++ b/lib/pki_base.h
@@ -57,6 +57,8 @@
#include "base.h"
+using namespace std;
+
class pki_base
{
Q_OBJECT
diff --git a/lib/pki_x509.cpp b/lib/pki_x509.cpp
index 1003feeb..4632045b 100644
--- a/lib/pki_x509.cpp
+++ b/lib/pki_x509.cpp
@@ -579,7 +579,7 @@ a1time pki_x509::getRevoked()
return x;
}
-void pki_x509::setRevoked(a1time &when)
+void pki_x509::setRevoked(const a1time &when)
{
isrevoked = true;
revoked = when;
diff --git a/lib/pki_x509.h b/lib/pki_x509.h
index f9ab5644..b05d6469 100644
--- a/lib/pki_x509.h
+++ b/lib/pki_x509.h
@@ -116,7 +116,7 @@ class pki_x509 : public pki_x509super
int getEffTrust();
void setEffTrust(int t);
void setRevoked(bool rev);
- void setRevoked(a1time &when);
+ void setRevoked(const a1time &when);
a1time getRevoked();
bool isRevoked();
int calcEffTrust();
diff --git a/validity.cpp b/validity.cpp
new file mode 100644
index 00000000..77be64c1
--- /dev/null
+++ b/validity.cpp
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2001 Christian Hohnstaedt.
+ *
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * - Neither the name of the author nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * This program links to software with different licenses from:
+ *
+ * http://www.openssl.org which includes cryptographic software
+ * written by Eric Young (eay@cryptsoft.com)"
+ *
+ * http://www.sleepycat.com
+ *
+ * http://www.trolltech.com
+ *
+ *
+ *
+ * http://www.hohnstaedt.de/xca
+ * email: christian@hohnstaedt.de
+ *
+ * $Id$
+ *
+ */
+
+#include "validity.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "lib/asn1time.h"
+
+Validity::Validity( QWidget* parent, const char* name )
+ : QGroupBox( parent, name )
+{
+ QStringList months, days;
+ months << tr("Jan") << tr("Feb") << tr("Mar") << tr("Apr")
+ << tr("Mai") << tr("Jun") << tr("Jul") << tr("Aug")
+ << tr("Sep") << tr("Okt") << tr("Nov") << tr("Dez");
+ for (int i=1; i<32; i++)
+ days += QString::number(i);
+
+ if ( !name )
+ setName( "Validity" );
+ setTitle( tr( "Validity" ) );
+ ValidityLayout = new QGridLayout( this );
+ ValidityLayout->setSpacing( 6 );
+ ValidityLayout->setMargin( 11 );
+
+ Label1 = new QLabel( this, "Label1" );
+ Label1->setText( tr( "not Before" ) );
+
+ Label2 = new QLabel( this, "Label2" );
+ Label2->setText( tr( "not After" ) );
+
+ nbDay = new QComboBox( FALSE, this, "nbDay" );
+ nbMon = new QComboBox( FALSE, this, "nbMon" );
+ nbYear = new QLineEdit( this, "nbYear" );
+
+ naDay = new QComboBox( FALSE, this, "naDay" );
+ naMon = new QComboBox( FALSE, this, "naMon" );
+ naYear = new QLineEdit( this, "naYear" );
+
+ ValidityLayout->addWidget( Label1, 0, 0 );
+ ValidityLayout->addWidget( nbDay, 0, 1 );
+ ValidityLayout->addWidget( nbMon, 0, 2 );
+ ValidityLayout->addWidget( nbYear, 0, 3 );
+
+ ValidityLayout->addWidget( Label2, 1, 0 );
+ ValidityLayout->addWidget( naDay, 1, 1 );
+ ValidityLayout->addWidget( naMon, 1, 2 );
+ ValidityLayout->addWidget( naYear, 1, 3 );
+
+
+ nbMon->insertStringList(months);
+ naMon->insertStringList(months);
+ nbDay->insertStringList(days);
+ naDay->insertStringList(days);
+}
+
+Validity::~Validity()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+a1time Validity::getNotBefore() const
+{
+ a1time date;
+ date.set(nbYear->text().toInt(), nbMon->currentItem() + 1,
+ nbDay->currentItem() +1, 0, 0, 0);
+ return date;
+}
+
+a1time Validity::getNotAfter() const
+{
+ a1time date;
+ date.set(naYear->text().toInt(), naMon->currentItem() + 1,
+ naDay->currentItem() +1, 0, 0, 0);
+ return date;
+}
+
+void Validity::setNotBefore(const a1time &a)
+{
+ int y, m, d, g;
+ a.ymdg(&y,&m,&d,&g);
+ nbYear->setText(QString::number(y));
+ nbMon->setCurrentItem(m-1);
+ nbDay->setCurrentItem(d-1);
+}
+
+void Validity::setNotAfter(const a1time &a)
+{
+ int y, m, d, g;
+ a.ymdg(&y,&m,&d,&g);
+ naYear->setText(QString::number(y));
+ naMon->setCurrentItem(m-1);
+ naDay->setCurrentItem(d-1);
+}
+
diff --git a/validity.h b/validity.h
new file mode 100644
index 00000000..ece02e65
--- /dev/null
+++ b/validity.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2001 Christian Hohnstaedt.
+ *
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * - Neither the name of the author nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * This program links to software with different licenses from:
+ *
+ * http://www.openssl.org which includes cryptographic software
+ * written by Eric Young (eay@cryptsoft.com)"
+ *
+ * http://www.sleepycat.com
+ *
+ * http://www.trolltech.com
+ *
+ *
+ *
+ * http://www.hohnstaedt.de/xca
+ * email: christian@hohnstaedt.de
+ *
+ * $Id$
+ *
+ */
+
+#ifndef VALIDITY_H
+#define VALIDITY_H
+
+#include
+#include
+
+class QGridLayout;
+class a1time;
+class QLabel;
+class QComboBox;
+class QLineEdit;
+
+class Validity : public QGroupBox
+{
+ Q_OBJECT
+
+ public:
+ Validity( QWidget* parent = 0, const char* name = 0);
+ ~Validity();
+ a1time getNotBefore() const;
+ a1time getNotAfter() const;
+ void setNotBefore(const a1time &t);
+ void setNotAfter(const a1time &t);
+
+ protected:
+ QGridLayout* ValidityLayout;
+ QLabel *Label1, *Label2;
+ QComboBox *nbDay, *nbMon, *naMon, *naDay;
+ QLineEdit *nbYear, *naYear;
+
+};
+
+#endif // VALIDITY_H