mirror of
https://github.com/chris2511/xca.git
synced 2026-09-12 19:51:05 +05:00
- enhance parsing of CRL-DP, SAN, IAN and AuthInfoAcc - add support for CertificatePolicies
63 lines
1.6 KiB
C++
63 lines
1.6 KiB
C++
/* vi: set sw=4 ts=4:
|
|
*
|
|
* Copyright (C) 2001 - 2010 Christian Hohnstaedt.
|
|
*
|
|
* All rights reserved.
|
|
*/
|
|
|
|
#ifndef __X509V3EXT_H
|
|
#define __X509V3EXT_H
|
|
|
|
#include <QtCore/QList>
|
|
#include <QtCore/QStringList>
|
|
#include <openssl/x509.h>
|
|
#include <openssl/x509v3.h>
|
|
|
|
class QString;
|
|
|
|
class x509v3ext
|
|
{
|
|
private:
|
|
X509_EXTENSION *ext;
|
|
public:
|
|
x509v3ext();
|
|
x509v3ext(const X509_EXTENSION *n);
|
|
x509v3ext(const x509v3ext &n);
|
|
~x509v3ext();
|
|
x509v3ext &set(const X509_EXTENSION *n);
|
|
x509v3ext &create(int nid, const QString &et, X509V3_CTX *ctx = NULL);
|
|
x509v3ext &operator = (const x509v3ext &x);
|
|
// bool operator == (const x509v3ext &x) const;
|
|
QString getObject() const;
|
|
int getCritical() const;
|
|
QString getValue(bool html=false) const;
|
|
QString getHtml() const;
|
|
X509_EXTENSION *get() const;
|
|
bool isValid() const;
|
|
int nid() const;
|
|
void *d2i();
|
|
bool genConf(QString *single, QString *adv) const;
|
|
protected:
|
|
QString parse_critical() const;
|
|
bool parse_certpol(QString *single, QString *adv) const;
|
|
bool parse_ainfo(QString *single, QString *adv) const;
|
|
bool parse_Crldp(QString *single, QString *adv) const;
|
|
bool parse_eku(QString *single, QString *adv) const;
|
|
bool parse_generalName(QString *single, QString *adv) const;
|
|
bool parse_i2s(QString *single, QString *adv) const;
|
|
bool parse_bc(QString *single, QString *adv) const;
|
|
};
|
|
|
|
class extList : public QList<x509v3ext>
|
|
{
|
|
public:
|
|
void setStack(STACK_OF(X509_EXTENSION) *st, int start=0);
|
|
STACK_OF(X509_EXTENSION) *getStack();
|
|
QString getHtml(const QString &sep);
|
|
bool delByNid(int nid);
|
|
int delInvalid();
|
|
int idxByNid(int nid);
|
|
bool genConf(int nid, QString *single, QString *adv = NULL);
|
|
};
|
|
#endif
|