mirror of
https://github.com/chris2511/xca.git
synced 2026-09-12 19:51:05 +05:00
Some checks are pending
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 5.15.2, ubuntu-latest) (push) Waiting to run
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 6.6.2, ubuntu-latest) (push) Waiting to run
CMake / build (build/xca-*.dmg, Unix Makefiles, mac, /opt/homebrew/opt/openssl, macos, 6.6.2, macos-latest) (push) Waiting to run
CMake / build (build/xca-*.msi
build/xca-portable-*.zip
, MinGW Makefiles, windows, D:\msys2\msys64\mingw64, windows, 5.15.2, windows-2019, win64_mingw81) (push) Waiting to run
Use the provided plural mechanisms of QT. The "PO" translation also works smoothly and the translation mechanisms between .po <-> .qt was tested successfully. The new english translation file translates the single phrase: "Delete the %n revocation list(s): '%1'?" into "Delete the revocation list: '%1'?" for one item and "Delete the %n revocation lists: '%1'?" otherwise
113 lines
2.8 KiB
C++
113 lines
2.8 KiB
C++
/* vi: set sw=4 ts=4:
|
|
*
|
|
* Copyright (C) 2001 - 2020 Christian Hohnstaedt.
|
|
*
|
|
* All rights reserved.
|
|
*/
|
|
|
|
|
|
#ifndef __PKI_CRL_H
|
|
#define __PKI_CRL_H
|
|
|
|
#include <openssl/bio.h>
|
|
#include "pki_x509.h"
|
|
#include "pki_key.h"
|
|
#include "x509name.h"
|
|
|
|
#define VIEW_crls_num 6
|
|
#define VIEW_crls_issuer 7
|
|
#define VIEW_crls_crl 8
|
|
|
|
#include "digest.h"
|
|
|
|
class crljob
|
|
{
|
|
public:
|
|
pki_x509 *issuer{};
|
|
bool withReason{};
|
|
bool authKeyId{};
|
|
bool subAltName{};
|
|
bool setCrlNumber{};
|
|
a1int crlNumber{};
|
|
int crlDays{};
|
|
digest hashAlgo{};
|
|
a1time lastUpdate{};
|
|
a1time nextUpdate{};
|
|
|
|
crljob(pki_x509 *x = nullptr) : issuer(x),
|
|
withReason(true),
|
|
authKeyId(true),
|
|
subAltName(true),
|
|
setCrlNumber(issuer->getCrlNumber().getLong() > 0),
|
|
crlNumber(issuer->getCrlNumber()),
|
|
crlDays(issuer->getCrlDays()),
|
|
hashAlgo(digest::getDefault()),
|
|
nextUpdate(lastUpdate.addDays(crlDays))
|
|
{
|
|
crlNumber++;
|
|
if (x) {
|
|
pki_key *key = x->getPubKey();
|
|
if (key)
|
|
hashAlgo.adjust(key->possibleHashNids());
|
|
delete key;
|
|
}
|
|
}
|
|
};
|
|
|
|
class pki_crl: public pki_x509name
|
|
{
|
|
Q_OBJECT
|
|
friend class pki_x509;
|
|
protected:
|
|
QVariant issuerSqlId{};
|
|
X509_CRL *crl{};
|
|
extList extensions() const;
|
|
void collect_properties(QMap<QString, QString> &prp) const;
|
|
public:
|
|
pki_crl(const QString &name = QString());
|
|
~pki_crl();
|
|
void fromPEM_BIO(BIO *bio, const QString &name);
|
|
void fload(const QString &fname);
|
|
QString getSigAlg() const;
|
|
void writeDefault(const QString &dirname) const;
|
|
void createCrl(const QString d, pki_x509 *iss);
|
|
void addRev(const x509rev &rev, bool withReason=true);
|
|
void addExt(int nid, QString value);
|
|
void addV3ext(const x509v3ext &e);
|
|
void sign(pki_key *key, const digest &digest);
|
|
void writeCrl(XFile &file, bool pem = true) const;
|
|
pki_x509 *getIssuer() const;
|
|
QString getIssuerName() const;
|
|
void setIssuer(pki_x509 *iss);
|
|
x509name getSubject() const;
|
|
void setLastUpdate(const a1time &t);
|
|
void setNextUpdate(const a1time &t);
|
|
a1time getNextUpdate() const;
|
|
a1time getLastUpdate() const;
|
|
bool verify(pki_x509 *issuer);
|
|
int numRev() const;
|
|
x509revList getRevList();
|
|
QString printV3ext();
|
|
x509v3ext getExtByNid(int nid);
|
|
a1int getVersion();
|
|
QVariant column_data(const dbheader *hd) const;
|
|
QVariant getIcon(const dbheader *hd) const;
|
|
a1time column_a1time(const dbheader *hd) const;
|
|
QString getMsg(msg_type msg, int n = 1) const;
|
|
void d2i(QByteArray &ba);
|
|
QByteArray i2d() const;
|
|
void setCrlNumber(a1int num);
|
|
bool getCrlNumber(a1int *num) const;
|
|
a1int getCrlNumber() const;
|
|
bool pem(BioByteArray &);
|
|
bool visible() const;
|
|
QSqlError lookupIssuer();
|
|
QSqlError insertSqlData();
|
|
QSqlError deleteSqlData();
|
|
void restoreSql(const QSqlRecord &rec);
|
|
QStringList icsVEVENT() const;
|
|
void print(BioByteArray &b, enum print_opt opt) const;
|
|
};
|
|
|
|
#endif
|