qca_cert.h
Go to the documentation of this file.
/*
* qca_cert.h - Qt Cryptographic Architecture
* Copyright (C) 2003-2007 Justin Karneges <justin@affinix.com>
* Copyright (C) 2004-2006 Brad Hards <bradh@frogmouth.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef QCA_CERT_H
#define QCA_CERT_H
#include "qca_core.h"
#include "qca_publickey.h"
#include <QDateTime>
namespace QCA {
class CertContext;
class CSRContext;
class CRLContext;
class Certificate;
class CRL;
class CertificateCollection;
class CertificateChain;
enum CertificateRequestFormat
{
PKCS10,
SPKAC
};
enum CertificateInfoTypeKnown
{
CommonName,
Email,
EmailLegacy,
Organization,
OrganizationalUnit,
Locality,
IncorporationLocality,
State,
IncorporationState,
Country,
IncorporationCountry,
URI,
DNS,
IPAddress,
XMPP
};
class QCA_EXPORT CertificateInfoType
{
public:
enum Section
{
DN,
AlternativeName
};
CertificateInfoType();
CertificateInfoType(CertificateInfoTypeKnown known);
CertificateInfoType(const QString &id, Section section);
CertificateInfoType(const CertificateInfoType &from);
~CertificateInfoType();
CertificateInfoType &operator=(const CertificateInfoType &from);
Section section() const;
CertificateInfoTypeKnown known() const;
QString id() const;
bool operator<(const CertificateInfoType &other) const;
bool operator==(const CertificateInfoType &other) const;
inline bool operator!=(const CertificateInfoType &other) const
{
return !(*this == other);
}
private:
class Private;
QSharedDataPointer<Private> d;
};
class QCA_EXPORT CertificateInfoPair
{
public:
CertificateInfoPair();
CertificateInfoPair(const CertificateInfoType &type, const QString &value);
CertificateInfoPair(const CertificateInfoPair &from);
~CertificateInfoPair();
CertificateInfoPair &operator=(const CertificateInfoPair &from);
CertificateInfoType type() const;
QString value() const;
bool operator==(const CertificateInfoPair &other) const;
inline bool operator!=(const CertificateInfoPair &other) const
{
return !(*this == other);
}
private:
class Private;
QSharedDataPointer<Private> d;
};
enum ConstraintTypeKnown
{
// KeyUsage
DigitalSignature,
NonRepudiation,
KeyEncipherment,
DataEncipherment,
KeyAgreement,
KeyCertificateSign,
CRLSign,
EncipherOnly,
DecipherOnly,
// ExtKeyUsage
ServerAuth,
ClientAuth,
CodeSigning,
EmailProtection,
IPSecEndSystem,
IPSecTunnel,
IPSecUser,
TimeStamping,
OCSPSigning
};
class QCA_EXPORT ConstraintType
{
public:
enum Section
{
KeyUsage,
ExtendedKeyUsage
};
ConstraintType();
ConstraintType(ConstraintTypeKnown known);
ConstraintType(const QString &id, Section section);
ConstraintType(const ConstraintType &from);
~ConstraintType();
ConstraintType &operator=(const ConstraintType &from);
Section section() const;
ConstraintTypeKnown known() const;
QString id() const;
bool operator<(const ConstraintType &other) const;
bool operator==(const ConstraintType &other) const;
inline bool operator!=(const ConstraintType &other) const
{
return !(*this == other);
}
private:
class Private;
QSharedDataPointer<Private> d;
};
enum UsageMode
{
UsageAny = 0x00,
UsageTLSServer = 0x01,
UsageTLSClient = 0x02,
UsageCodeSigning = 0x04,
UsageEmailProtection = 0x08,
UsageTimeStamping = 0x10,
UsageCRLSigning = 0x20
};
enum Validity
{
ValidityGood,
ErrorRejected,
ErrorUntrusted,
ErrorSignatureFailed,
ErrorInvalidCA,
ErrorInvalidPurpose,
ErrorSelfSigned,
ErrorRevoked,
ErrorPathLengthExceeded,
ErrorExpired,
ErrorExpiredCA,
ErrorValidityUnknown = 64
};
enum ValidateFlags
{
ValidateAll = 0x00, // Verify all conditions
ValidateRevoked = 0x01, // Verify the certificate was not revoked
ValidateExpired = 0x02, // Verify the certificate has not expired
ValidatePolicy = 0x04 // Verify the certificate can be used for a specified purpose
};
typedef QMultiMap<CertificateInfoType, QString> CertificateInfo;
class CertificateInfoOrdered : public QList<CertificateInfoPair>
{
public:
inline QString toString() const;
inline CertificateInfoOrdered dnOnly() const;
};
QCA_EXPORT QString orderedToDNString(const CertificateInfoOrdered &in);
QCA_EXPORT CertificateInfoOrdered orderedDNOnly(const CertificateInfoOrdered &in);
inline QString CertificateInfoOrdered::toString() const
{
return orderedToDNString(*this);
}
inline CertificateInfoOrdered CertificateInfoOrdered::dnOnly() const
{
return orderedDNOnly(*this);
}
typedef QList<ConstraintType> Constraints;
QCA_EXPORT QStringList makeFriendlyNames(const QList<Certificate> &list);
class QCA_EXPORT CertificateOptions
{
public:
CertificateOptions(CertificateRequestFormat format = PKCS10);
CertificateOptions(const CertificateOptions &from);
~CertificateOptions();
CertificateOptions &operator=(const CertificateOptions &from);
CertificateRequestFormat format() const;
void setFormat(CertificateRequestFormat f);
bool isValid() const;
QString challenge() const;
CertificateInfo info() const;
CertificateInfoOrdered infoOrdered() const;
Constraints constraints() const;
QStringList policies() const;
QStringList crlLocations() const;
QStringList issuerLocations() const;
QStringList ocspLocations() const;
bool isCA() const;
int pathLimit() const;
BigInteger serialNumber() const;
QDateTime notValidBefore() const;
QDateTime notValidAfter() const;
void setChallenge(const QString &s);
void setInfo(const CertificateInfo &info);
void setInfoOrdered(const CertificateInfoOrdered &info);
void setConstraints(const Constraints &constraints);
void setPolicies(const QStringList &policies);
void setCRLLocations(const QStringList &locations);
void setIssuerLocations(const QStringList &locations);
void setOCSPLocations(const QStringList &locations);
void setAsCA(int pathLimit = 8); // value from Botan
void setAsUser();
void setSerialNumber(const BigInteger &i);
void setValidityPeriod(const QDateTime &start, const QDateTime &end);
private:
class Private;
Private *d;
};
class QCA_EXPORT Certificate : public Algorithm
{
public:
Certificate();
Certificate(const QString &fileName);
Certificate(const CertificateOptions &opts, const PrivateKey &key, const QString &provider = QString());
Certificate(const Certificate &from);
~Certificate() override;
Certificate &operator=(const Certificate &from);
bool isNull() const;
QDateTime notValidBefore() const;
QDateTime notValidAfter() const;
CertificateInfo subjectInfo() const;
CertificateInfoOrdered subjectInfoOrdered() const;
CertificateInfo issuerInfo() const;
CertificateInfoOrdered issuerInfoOrdered() const;
Constraints constraints() const;
QStringList policies() const;
QStringList crlLocations() const;
QStringList issuerLocations() const;
QStringList ocspLocations() const;
QString commonName() const;
BigInteger serialNumber() const;
PublicKey subjectPublicKey() const;
bool isCA() const;
bool isSelfSigned() const;
bool isIssuerOf(const Certificate &other) const;
int pathLimit() const;
SignatureAlgorithm signatureAlgorithm() const;
QByteArray subjectKeyId() const;
QByteArray issuerKeyId() const;
Validity validate(const CertificateCollection &trusted,
const CertificateCollection &untrusted,
UsageMode u = UsageAny,
ValidateFlags vf = ValidateAll) const;
QByteArray toDER() const;
QString toPEM() const;
bool toPEMFile(const QString &fileName) const;
static Certificate
fromDER(const QByteArray &a, ConvertResult *result = nullptr, const QString &provider = QString());
static Certificate fromPEM(const QString &s, ConvertResult *result = nullptr, const QString &provider = QString());
static Certificate
fromPEMFile(const QString &fileName, ConvertResult *result = nullptr, const QString &provider = QString());
bool matchesHostName(const QString &host) const;
bool operator==(const Certificate &a) const;
inline bool operator!=(const Certificate &other) const
{
return !(*this == other);
}
void change(CertContext *c);
private:
class Private;
friend class Private;
QSharedDataPointer<Private> d;
friend class CertificateChain;
Validity chain_validate(const CertificateChain &chain,
const CertificateCollection &trusted,
const QList<CRL> &untrusted_crls,
UsageMode u,
ValidateFlags vf) const;
CertificateChain
chain_complete(const CertificateChain &chain, const QList<Certificate> &issuers, Validity *result) const;
};
class CertificateChain : public QList<Certificate>
{
public:
inline CertificateChain()
{
}
inline CertificateChain(const Certificate &primary)
{
append(primary);
}
inline const Certificate &primary() const
{
return first();
}
inline Validity validate(const CertificateCollection &trusted,
const QList<CRL> &untrusted_crls = QList<CRL>(),
UsageMode u = UsageAny,
ValidateFlags vf = ValidateAll) const;
inline CertificateChain complete(const QList<Certificate> &issuers = QList<Certificate>(),
Validity *result = nullptr) const;
};
inline Validity CertificateChain::validate(const CertificateCollection &trusted,
const QList<CRL> &untrusted_crls,
UsageMode u,
ValidateFlags vf) const
{
if (isEmpty())
return ErrorValidityUnknown;
return first().chain_validate(*this, trusted, untrusted_crls, u, vf);
}
inline CertificateChain CertificateChain::complete(const QList<Certificate> &issuers, Validity *result) const
{
if (isEmpty())
return CertificateChain();
return first().chain_complete(*this, issuers, result);
}
class QCA_EXPORT CertificateRequest : public Algorithm
{
public:
CertificateRequest();
CertificateRequest(const QString &fileName);
CertificateRequest(const CertificateOptions &opts, const PrivateKey &key, const QString &provider = QString());
CertificateRequest(const CertificateRequest &from);
~CertificateRequest() override;
CertificateRequest &operator=(const CertificateRequest &from);
bool isNull() const;
static bool canUseFormat(CertificateRequestFormat f, const QString &provider = QString());
CertificateRequestFormat format() const;
CertificateInfo subjectInfo() const;
CertificateInfoOrdered subjectInfoOrdered() const;
Constraints constraints() const;
QStringList policies() const;
PublicKey subjectPublicKey() const;
bool isCA() const;
int pathLimit() const;
QString challenge() const;
SignatureAlgorithm signatureAlgorithm() const;
bool operator==(const CertificateRequest &csr) const;
inline bool operator!=(const CertificateRequest &other) const
{
return !(*this == other);
}
QByteArray toDER() const;
QString toPEM() const;
bool toPEMFile(const QString &fileName) const;
static CertificateRequest
fromDER(const QByteArray &a, ConvertResult *result = nullptr, const QString &provider = QString());
static CertificateRequest
fromPEM(const QString &s, ConvertResult *result = nullptr, const QString &provider = QString());
static CertificateRequest
fromPEMFile(const QString &fileName, ConvertResult *result = nullptr, const QString &provider = QString());
QString toString() const;
static CertificateRequest
fromString(const QString &s, ConvertResult *result = nullptr, const QString &provider = QString());
void change(CSRContext *c);
private:
class Private;
friend class Private;
QSharedDataPointer<Private> d;
};
class QCA_EXPORT CRLEntry
{
public:
enum Reason
{
Unspecified,
KeyCompromise,
CACompromise,
AffiliationChanged,
Superseded,
CessationOfOperation,
CertificateHold,
RemoveFromCRL,
PrivilegeWithdrawn,
AACompromise
};
CRLEntry();
explicit CRLEntry(const Certificate &c, Reason r = Unspecified);
CRLEntry(const BigInteger serial, const QDateTime &time, Reason r = Unspecified);
CRLEntry(const CRLEntry &from);
~CRLEntry();
CRLEntry &operator=(const CRLEntry &from);
BigInteger serialNumber() const;
QDateTime time() const;
bool isNull() const;
Reason reason() const;
bool operator<(const CRLEntry &a) const;
bool operator==(const CRLEntry &a) const;
inline bool operator!=(const CRLEntry &other) const
{
return !(*this == other);
}
private:
BigInteger _serial;
QDateTime _time;
Reason _reason;
class Private;
Private *d;
};
class QCA_EXPORT CRL : public Algorithm
{
public:
CRL();
CRL(const CRL &from);
~CRL() override;
CRL &operator=(const CRL &from);
bool isNull() const;
CertificateInfo issuerInfo() const;
CertificateInfoOrdered issuerInfoOrdered() const;
int number() const;
QDateTime thisUpdate() const;
QDateTime nextUpdate() const;
QList<CRLEntry> revoked() const;
SignatureAlgorithm signatureAlgorithm() const;
QByteArray issuerKeyId() const;
bool operator==(const CRL &a) const;
inline bool operator!=(const CRL &other) const
{
return !(*this == other);
}
QByteArray toDER() const;
QString toPEM() const;
bool toPEMFile(const QString &fileName) const;
static CRL fromDER(const QByteArray &a, ConvertResult *result = nullptr, const QString &provider = QString());
static CRL fromPEM(const QString &s, ConvertResult *result = nullptr, const QString &provider = QString());
static CRL
fromPEMFile(const QString &fileName, ConvertResult *result = nullptr, const QString &provider = QString());
void change(CRLContext *c);
private:
class Private;
friend class Private;
QSharedDataPointer<Private> d;
};
class QCA_EXPORT CertificateCollection
{
public:
CertificateCollection();
CertificateCollection(const CertificateCollection &from);
~CertificateCollection();
CertificateCollection &operator=(const CertificateCollection &from);
void addCertificate(const Certificate &cert);
void addCRL(const CRL &crl);
QList<Certificate> certificates() const;
QList<CRL> crls() const;
void append(const CertificateCollection &other);
CertificateCollection operator+(const CertificateCollection &other) const;
CertificateCollection &operator+=(const CertificateCollection &other);
static bool canUsePKCS7(const QString &provider = QString());
bool toFlatTextFile(const QString &fileName);
bool toPKCS7File(const QString &fileName, const QString &provider = QString());
static CertificateCollection
fromFlatTextFile(const QString &fileName, ConvertResult *result = nullptr, const QString &provider = QString());
static CertificateCollection
fromPKCS7File(const QString &fileName, ConvertResult *result = nullptr, const QString &provider = QString());
private:
class Private;
QSharedDataPointer<Private> d;
};
class QCA_EXPORT CertificateAuthority : public Algorithm
{
public:
CertificateAuthority(const Certificate &cert, const PrivateKey &key, const QString &provider);
CertificateAuthority(const CertificateAuthority &from);
~CertificateAuthority() override;
CertificateAuthority &operator=(const CertificateAuthority &from);
Certificate certificate() const;
Certificate signRequest(const CertificateRequest &req, const QDateTime &notValidAfter) const;
Certificate createCertificate(const PublicKey &key, const CertificateOptions &opts) const;
CRL createCRL(const QDateTime &nextUpdate) const;
CRL updateCRL(const CRL &crl, const QList<CRLEntry> &entries, const QDateTime &nextUpdate) const;
private:
class Private;
Private *d;
};
class QCA_EXPORT KeyBundle
{
public:
KeyBundle();
explicit KeyBundle(const QString &fileName, const SecureArray &passphrase = SecureArray());
KeyBundle(const KeyBundle &from);
~KeyBundle();
KeyBundle &operator=(const KeyBundle &from);
bool isNull() const;
QString name() const;
CertificateChain certificateChain() const;
PrivateKey privateKey() const;
void setName(const QString &s);
void setCertificateChainAndKey(const CertificateChain &c, const PrivateKey &key);
QByteArray toArray(const SecureArray &passphrase, const QString &provider = QString()) const;
bool toFile(const QString &fileName, const SecureArray &passphrase, const QString &provider = QString()) const;
static KeyBundle fromArray(const QByteArray &a,
const SecureArray &passphrase = SecureArray(),
ConvertResult *result = nullptr,
const QString &provider = QString());
static KeyBundle fromFile(const QString &fileName,
const SecureArray &passphrase = SecureArray(),
ConvertResult *result = nullptr,
const QString &provider = QString());
private:
class Private;
QSharedDataPointer<Private> d;
};
class QCA_EXPORT PGPKey : public Algorithm
{
public:
PGPKey();
PGPKey(const QString &fileName);
PGPKey(const PGPKey &from);
~PGPKey() override;
PGPKey &operator=(const PGPKey &from);
bool isNull() const;
QString keyId() const;
QString primaryUserId() const;
QStringList userIds() const;
bool isSecret() const;
QDateTime creationDate() const;
QDateTime expirationDate() const;
QString fingerprint() const;
bool inKeyring() const;
bool isTrusted() const;
QByteArray toArray() const;
QString toString() const;
bool toFile(const QString &fileName) const;
static PGPKey fromArray(const QByteArray &a, ConvertResult *result = nullptr, const QString &provider = QString());
static PGPKey fromString(const QString &s, ConvertResult *result = nullptr, const QString &provider = QString());
static PGPKey
fromFile(const QString &fileName, ConvertResult *result = nullptr, const QString &provider = QString());
private:
class Private;
Private *d;
};
class QCA_EXPORT KeyLoader : public QObject
{
Q_OBJECT
public:
KeyLoader(QObject *parent = nullptr);
~KeyLoader() override;
void loadPrivateKeyFromPEMFile(const QString &fileName);
void loadPrivateKeyFromPEM(const QString &s);
void loadPrivateKeyFromDER(const SecureArray &a);
void loadKeyBundleFromFile(const QString &fileName);
void loadKeyBundleFromArray(const QByteArray &a);
ConvertResult convertResult() const;
PrivateKey privateKey() const;
KeyBundle keyBundle() const;
Q_SIGNALS:
void finished();
private:
Q_DISABLE_COPY(KeyLoader)
class Private;
friend class Private;
Private *d;
};
}
#endif
QCA::Algorithm::provider
Provider * provider() const
The name of the provider.
QCA::Algorithm::Algorithm
Algorithm(const Algorithm &from)
Standard copy constructor.
QCA::BigInteger
Arbitrary precision integer.
Definition qca_tools.h:571
QCA::CRLContext
X.509 certificate revocation list provider.
Definition qcaprovider.h:1513
QCA::CRLEntry::serialNumber
BigInteger serialNumber() const
The serial number of the certificate that is the subject of this CRL entry.
QCA::CRLEntry::CRLEntry
CRLEntry()
create an empty CRL entry
QCA::CRLEntry::reason
Reason reason() const
The reason that this CRL entry was created.
QCA::CRLEntry::operator=
CRLEntry & operator=(const CRLEntry &from)
Standard assignment operator.
QCA::CRLEntry::operator!=
bool operator!=(const CRLEntry &other) const
Inequality operator.
Definition qca_cert.h:1705
QCA::CRLEntry::Reason
Reason
The reason why the certificate has been revoked.
Definition qca_cert.h:1607
QCA::CRLEntry::CACompromise
@ CACompromise
certificate authority has been compromised
Definition qca_cert.h:1610
QCA::CRLEntry::Unspecified
@ Unspecified
reason is unknown
Definition qca_cert.h:1608
QCA::CRLEntry::CertificateHold
@ CertificateHold
certificate is on hold
Definition qca_cert.h:1614
QCA::CRLEntry::AACompromise
@ AACompromise
attribute authority has been compromised
Definition qca_cert.h:1617
QCA::CRLEntry::KeyCompromise
@ KeyCompromise
private key has been compromised
Definition qca_cert.h:1609
QCA::CRLEntry::Superseded
@ Superseded
certificate has been superseded
Definition qca_cert.h:1612
QCA::CRLEntry::RemoveFromCRL
@ RemoveFromCRL
certificate was previously in a CRL, but is now valid
Definition qca_cert.h:1615
QCA::CRLEntry::CRLEntry
CRLEntry(const CRLEntry &from)
Copy constructor.
QCA::CRLEntry::operator<
bool operator<(const CRLEntry &a) const
Test if one CRL entry is "less than" another.
QCA::CRLEntry::isNull
bool isNull() const
Test if this CRL entry is empty.
QCA::CRLEntry::operator==
bool operator==(const CRLEntry &a) const
Test for equality of two CRL Entries.
QCA::CRLEntry::CRLEntry
CRLEntry(const BigInteger serial, const QDateTime &time, Reason r=Unspecified)
create a CRL entry
QCA::CRLEntry::CRLEntry
CRLEntry(const Certificate &c, Reason r=Unspecified)
create a CRL entry
QCA::CRLEntry::time
QDateTime time() const
The time this CRL entry was created.
QCA::CRL
Certificate Revocation List
Definition qca_cert.h:1740
QCA::CRL::revoked
QList< CRLEntry > revoked() const
a list of the revoked certificates in this CRL
QCA::CRL::fromPEMFile
static CRL fromPEMFile(const QString &fileName, ConvertResult *result=nullptr, const QString &provider=QString())
Import a PEM encoded Certificate Revocation List (CRL) from a file.
QCA::CRL::change
void change(CRLContext *c)
QCA::CRL::issuerKeyId
QByteArray issuerKeyId() const
The key identification of the CRL issuer.
QCA::CRL::isNull
bool isNull() const
Test if the CRL is empty.
QCA::CRL::fromPEM
static CRL fromPEM(const QString &s, ConvertResult *result=nullptr, const QString &provider=QString())
Import a PEM encoded Certificate Revocation List (CRL).
QCA::CRL::thisUpdate
QDateTime thisUpdate() const
the time that this CRL became (or becomes) valid
QCA::CRL::nextUpdate
QDateTime nextUpdate() const
the time that this CRL will be obsoleted
QCA::CRL::operator=
CRL & operator=(const CRL &from)
Standard assignment operator.
QCA::CRL::toPEM
QString toPEM() const
Export the Certificate Revocation List (CRL) in PEM format.
QCA::CRL::toPEMFile
bool toPEMFile(const QString &fileName) const
Export the Certificate Revocation List (CRL) into PEM format in a file.
QCA::CRL::signatureAlgorithm
SignatureAlgorithm signatureAlgorithm() const
The signature algorithm used for the signature on this CRL.
QCA::CRL::operator==
bool operator==(const CRL &a) const
Test for equality of two Certificate Revocation Lists.
QCA::CRL::issuerInfoOrdered
CertificateInfoOrdered issuerInfoOrdered() const
Information on the issuer of the CRL as an ordered list (QList of CertificateInfoPair).
QCA::CRL::number
int number() const
The CRL serial number.
QCA::CRL::issuerInfo
CertificateInfo issuerInfo() const
Information on the issuer of the CRL as a QMultiMap.
QCA::CRL::operator!=
bool operator!=(const CRL &other) const
Inequality operator.
Definition qca_cert.h:1834
QCA::CRL::toDER
QByteArray toDER() const
Export the Certificate Revocation List (CRL) in DER format.
QCA::CRL::CRL
CRL(const CRL &from)
Standard copy constructor.
QCA::CRL::fromDER
static CRL fromDER(const QByteArray &a, ConvertResult *result=nullptr, const QString &provider=QString())
Import a DER encoded Certificate Revocation List (CRL).
QCA::CSRContext
X.509 certificate request provider.
Definition qcaprovider.h:1429
QCA::CertContext
X.509 certificate provider.
Definition qcaprovider.h:1325
QCA::CertificateAuthority::createCRL
CRL createCRL(const QDateTime &nextUpdate) const
Create a new Certificate Revocation List (CRL).
QCA::CertificateAuthority::createCertificate
Certificate createCertificate(const PublicKey &key, const CertificateOptions &opts) const
Create a new Certificate.
QCA::CertificateAuthority::updateCRL
CRL updateCRL(const CRL &crl, const QList< CRLEntry > &entries, const QDateTime &nextUpdate) const
Update the CRL to include new entries.
QCA::CertificateAuthority::CertificateAuthority
CertificateAuthority(const Certificate &cert, const PrivateKey &key, const QString &provider)
Create a new Certificate Authority.
QCA::CertificateAuthority::CertificateAuthority
CertificateAuthority(const CertificateAuthority &from)
Copy constructor.
QCA::CertificateAuthority::signRequest
Certificate signRequest(const CertificateRequest &req, const QDateTime &notValidAfter) const
Create a new Certificate by signing the provider CertificateRequest.
QCA::CertificateAuthority::certificate
Certificate certificate() const
The Certificate belonging to the CertificateAuthority.
QCA::CertificateAuthority::operator=
CertificateAuthority & operator=(const CertificateAuthority &from)
Standard assignment operator.
QCA::CertificateChain
A chain of related Certificates.
Definition qca_cert.h:1226
QCA::CertificateChain::CertificateChain
CertificateChain(const Certificate &primary)
Create a certificate chain, starting at the specified certificate.
Definition qca_cert.h:1241
QCA::CertificateChain::CertificateChain
CertificateChain()
Create an empty certificate chain.
Definition qca_cert.h:1231
QCA::CertificateChain::primary
const Certificate & primary() const
Return the primary (end-user) Certificate.
Definition qca_cert.h:1249
QCA::CertificateChain::validate
Validity validate(const CertificateCollection &trusted, const QList< CRL > &untrusted_crls=QList< CRL >(), UsageMode u=UsageAny, ValidateFlags vf=ValidateAll) const
Check the validity of a certificate chain.
Definition qca_cert.h:1299
QCA::CertificateChain::complete
CertificateChain complete(const QList< Certificate > &issuers=QList< Certificate >(), Validity *result=nullptr) const
Complete a certificate chain for the primary certificate, using the rest of the certificates in the c...
Definition qca_cert.h:1309
QCA::CertificateCollection
Bundle of Certificates and CRLs.
Definition qca_cert.h:1929
QCA::CertificateCollection::addCRL
void addCRL(const CRL &crl)
Append a CRL to this collection.
QCA::CertificateCollection::toPKCS7File
bool toPKCS7File(const QString &fileName, const QString &provider=QString())
export the CertificateCollection to a PKCS#7 file
QCA::CertificateCollection::operator+=
CertificateCollection & operator+=(const CertificateCollection &other)
Add another CertificateCollection to this collection.
QCA::CertificateCollection::certificates
QList< Certificate > certificates() const
The Certificates in this collection.
QCA::CertificateCollection::fromFlatTextFile
static CertificateCollection fromFlatTextFile(const QString &fileName, ConvertResult *result=nullptr, const QString &provider=QString())
import a CertificateCollection from a text file
QCA::CertificateCollection::CertificateCollection
CertificateCollection()
Create an empty Certificate / CRL collection.
QCA::CertificateCollection::operator=
CertificateCollection & operator=(const CertificateCollection &from)
Standard assignment operator.
QCA::CertificateCollection::append
void append(const CertificateCollection &other)
Add another CertificateCollection to this collection.
QCA::CertificateCollection::canUsePKCS7
static bool canUsePKCS7(const QString &provider=QString())
test if the CertificateCollection can be imported and exported to PKCS#7 format
QCA::CertificateCollection::CertificateCollection
CertificateCollection(const CertificateCollection &from)
Standard copy constructor.
QCA::CertificateCollection::crls
QList< CRL > crls() const
The CRLs in this collection.
QCA::CertificateCollection::operator+
CertificateCollection operator+(const CertificateCollection &other) const
Add another CertificateCollection to this collection.
QCA::CertificateCollection::fromPKCS7File
static CertificateCollection fromPKCS7File(const QString &fileName, ConvertResult *result=nullptr, const QString &provider=QString())
import a CertificateCollection from a PKCS#7 file
QCA::CertificateCollection::toFlatTextFile
bool toFlatTextFile(const QString &fileName)
export the CertificateCollection to a plain text file
QCA::CertificateCollection::addCertificate
void addCertificate(const Certificate &cert)
Append a Certificate to this collection.
QCA::CertificateInfoOrdered
Ordered certificate properties type.
Definition qca_cert.h:548
QCA::CertificateInfoOrdered::toString
QString toString() const
Convert to RFC 1779 string format.
Definition qca_cert.h:577
QCA::CertificateInfoOrdered::dnOnly
CertificateInfoOrdered dnOnly() const
Return a new CertificateInfoOrdered that only contains the Distinguished Name (DN) types found in thi...
Definition qca_cert.h:582
QCA::CertificateInfoPair::CertificateInfoPair
CertificateInfoPair(const CertificateInfoPair &from)
Standard copy constructor.
QCA::CertificateInfoPair::operator!=
bool operator!=(const CertificateInfoPair &other) const
Inequality operator.
Definition qca_cert.h:301
QCA::CertificateInfoPair::CertificateInfoPair
CertificateInfoPair(const CertificateInfoType &type, const QString &value)
Construct a new pair.
QCA::CertificateInfoPair::value
QString value() const
The value of the information stored in the pair.
QCA::CertificateInfoPair::operator=
CertificateInfoPair & operator=(const CertificateInfoPair &from)
Standard assignment operator.
QCA::CertificateInfoPair::operator==
bool operator==(const CertificateInfoPair &other) const
Comparison operator.
QCA::CertificateInfoPair::CertificateInfoPair
CertificateInfoPair()
Standard constructor.
QCA::CertificateInfoPair::type
CertificateInfoType type() const
The type of information stored in the pair.
QCA::CertificateInfoType
Certificate information type.
Definition qca_cert.h:120
QCA::CertificateInfoType::operator<
bool operator<(const CertificateInfoType &other) const
Comparison operator.
QCA::CertificateInfoType::operator=
CertificateInfoType & operator=(const CertificateInfoType &from)
Standard assignment operator.
QCA::CertificateInfoType::operator==
bool operator==(const CertificateInfoType &other) const
Comparison operator.
QCA::CertificateInfoType::known
CertificateInfoTypeKnown known() const
The type as part of the CertificateInfoTypeKnown enumerator.
QCA::CertificateInfoType::section
Section section() const
The section the type is part of.
QCA::CertificateInfoType::CertificateInfoType
CertificateInfoType(CertificateInfoTypeKnown known)
Construct a new type.
QCA::CertificateInfoType::operator!=
bool operator!=(const CertificateInfoType &other) const
Inequality operator.
Definition qca_cert.h:228
QCA::CertificateInfoType::id
QString id() const
The type as an identifier string.
QCA::CertificateInfoType::CertificateInfoType
CertificateInfoType(const QString &id, Section section)
Construct a new type.
QCA::CertificateInfoType::Section
Section
Section of the certificate that the information belongs in.
Definition qca_cert.h:126
QCA::CertificateInfoType::DN
@ DN
Distinguished name (the primary name).
Definition qca_cert.h:127
QCA::CertificateInfoType::AlternativeName
@ AlternativeName
Alternative name.
Definition qca_cert.h:128
QCA::CertificateInfoType::CertificateInfoType
CertificateInfoType()
Standard constructor.
QCA::CertificateInfoType::CertificateInfoType
CertificateInfoType(const CertificateInfoType &from)
Standard copy constructor.
QCA::CertificateOptions
Certificate options
Definition qca_cert.h:610
QCA::CertificateOptions::serialNumber
BigInteger serialNumber() const
The serial number for the certificate.
QCA::CertificateOptions::operator=
CertificateOptions & operator=(const CertificateOptions &from)
Standard assignment operator.
QCA::CertificateOptions::notValidBefore
QDateTime notValidBefore() const
the first time the certificate will be valid
QCA::CertificateOptions::setInfo
void setInfo(const CertificateInfo &info)
Specify information for the subject associated with the certificate.
QCA::CertificateOptions::setPolicies
void setPolicies(const QStringList &policies)
set the policies on the certificate
QCA::CertificateOptions::isCA
bool isCA() const
test if the certificate is a CA cert
QCA::CertificateOptions::infoOrdered
CertificateInfoOrdered infoOrdered() const
Information on the subject of the certificate, in the exact order the items will be written.
QCA::CertificateOptions::setCRLLocations
void setCRLLocations(const QStringList &locations)
set the CRL locations of the certificate
QCA::CertificateOptions::crlLocations
QStringList crlLocations() const
list of URI locations for CRL files
QCA::CertificateOptions::setOCSPLocations
void setOCSPLocations(const QStringList &locations)
set the OCSP service locations of the certificate
QCA::CertificateOptions::setInfoOrdered
void setInfoOrdered(const CertificateInfoOrdered &info)
Specify information for the subject associated with the certificate.
QCA::CertificateOptions::setChallenge
void setChallenge(const QString &s)
Specify the challenge associated with this certificate.
QCA::CertificateOptions::setIssuerLocations
void setIssuerLocations(const QStringList &locations)
set the issuer certificate locations of the certificate
QCA::CertificateOptions::CertificateOptions
CertificateOptions(const CertificateOptions &from)
Standard copy constructor.
QCA::CertificateOptions::setValidityPeriod
void setValidityPeriod(const QDateTime &start, const QDateTime &end)
Set the validity period for the certificate.
QCA::CertificateOptions::notValidAfter
QDateTime notValidAfter() const
the last time the certificate is valid
QCA::CertificateOptions::setConstraints
void setConstraints(const Constraints &constraints)
set the constraints on the certificate
QCA::CertificateOptions::challenge
QString challenge() const
The challenge part of the certificate.
QCA::CertificateOptions::setFormat
void setFormat(CertificateRequestFormat f)
Specify the format for this certificate.
QCA::CertificateOptions::setAsCA
void setAsCA(int pathLimit=8)
set the certificate to be a CA cert
QCA::CertificateOptions::format
CertificateRequestFormat format() const
test the format type for this certificate
QCA::CertificateOptions::info
CertificateInfo info() const
Information on the subject of the certificate.
QCA::CertificateOptions::setSerialNumber
void setSerialNumber(const BigInteger &i)
Set the serial number property on this certificate.
QCA::CertificateOptions::setAsUser
void setAsUser()
set the certificate to be a user cert (this is the default)
QCA::CertificateOptions::issuerLocations
QStringList issuerLocations() const
list of URI locations for issuer certificate files
QCA::CertificateOptions::constraints
Constraints constraints() const
List the constraints on this certificate.
QCA::CertificateOptions::isValid
bool isValid() const
Test if the certificate options object is valid.
QCA::CertificateOptions::ocspLocations
QStringList ocspLocations() const
list of URI locations for OCSP services
QCA::CertificateOptions::pathLimit
int pathLimit() const
return the path limit on this certificate
QCA::CertificateOptions::policies
QStringList policies() const
list the policies on this certificate
QCA::CertificateOptions::CertificateOptions
CertificateOptions(CertificateRequestFormat format=PKCS10)
Create a Certificate options set.
QCA::CertificateRequest
Certificate Request
Definition qca_cert.h:1326
QCA::CertificateRequest::toString
QString toString() const
Export the CertificateRequest to a string.
QCA::CertificateRequest::fromPEM
static CertificateRequest fromPEM(const QString &s, ConvertResult *result=nullptr, const QString &provider=QString())
Import the certificate request from PEM format.
QCA::CertificateRequest::policies
QStringList policies() const
The policies that apply to this certificate request.
QCA::CertificateRequest::CertificateRequest
CertificateRequest(const CertificateRequest &from)
Standard copy constructor.
QCA::CertificateRequest::operator=
CertificateRequest & operator=(const CertificateRequest &from)
Standard assignment operator.
QCA::CertificateRequest::isNull
bool isNull() const
test if the certificate request is empty
QCA::CertificateRequest::operator==
bool operator==(const CertificateRequest &csr) const
Test for equality of two certificate requests.
QCA::CertificateRequest::toDER
QByteArray toDER() const
Export the Certificate Request into a DER format.
QCA::CertificateRequest::canUseFormat
static bool canUseFormat(CertificateRequestFormat f, const QString &provider=QString())
Test if the certificate request can use a specified format.
QCA::CertificateRequest::toPEMFile
bool toPEMFile(const QString &fileName) const
Export the Certificate into PEM format in a file.
QCA::CertificateRequest::fromDER
static CertificateRequest fromDER(const QByteArray &a, ConvertResult *result=nullptr, const QString &provider=QString())
Import the certificate request from DER.
QCA::CertificateRequest::operator!=
bool operator!=(const CertificateRequest &other) const
Inequality operator.
Definition qca_cert.h:1473
QCA::CertificateRequest::challenge
QString challenge() const
The challenge associated with this certificate request.
QCA::CertificateRequest::subjectInfoOrdered
CertificateInfoOrdered subjectInfoOrdered() const
Information on the subject of the certificate being requested, as an ordered list (QList of Certifica...
QCA::CertificateRequest::CertificateRequest
CertificateRequest(const CertificateOptions &opts, const PrivateKey &key, const QString &provider=QString())
Create a certificate request based on specified options.
QCA::CertificateRequest::CertificateRequest
CertificateRequest()
Create an empty certificate request.
QCA::CertificateRequest::toPEM
QString toPEM() const
Export the Certificate Request into a PEM format.
QCA::CertificateRequest::isCA
bool isCA() const
Test if this Certificate Request is for a Certificate Authority certificate.
QCA::CertificateRequest::CertificateRequest
CertificateRequest(const QString &fileName)
Create a certificate request based on the contents of a file.
QCA::CertificateRequest::signatureAlgorithm
SignatureAlgorithm signatureAlgorithm() const
The algorithm used to make the signature on this certificate request.
QCA::CertificateRequest::subjectInfo
CertificateInfo subjectInfo() const
Information on the subject of the certificate being requested.
QCA::CertificateRequest::pathLimit
int pathLimit() const
The path limit for the certificate in this Certificate Request.
QCA::CertificateRequest::constraints
Constraints constraints() const
The constraints that apply to this certificate request.
QCA::CertificateRequest::format
CertificateRequestFormat format() const
the format that this Certificate request is in
QCA::CertificateRequest::change
void change(CSRContext *c)
QCA::CertificateRequest::fromPEMFile
static CertificateRequest fromPEMFile(const QString &fileName, ConvertResult *result=nullptr, const QString &provider=QString())
Import the certificate request from a file.
QCA::CertificateRequest::subjectPublicKey
PublicKey subjectPublicKey() const
The public key belonging to the issuer.
QCA::CertificateRequest::fromString
static CertificateRequest fromString(const QString &s, ConvertResult *result=nullptr, const QString &provider=QString())
Import the CertificateRequest from a string.
QCA::Certificate
Public Key (X.509) certificate.
Definition qca_cert.h:857
QCA::Certificate::matchesHostName
bool matchesHostName(const QString &host) const
Test if the subject of the certificate matches a specified host name.
QCA::Certificate::signatureAlgorithm
SignatureAlgorithm signatureAlgorithm() const
The signature algorithm used for the signature on this certificate.
QCA::Certificate::fromPEM
static Certificate fromPEM(const QString &s, ConvertResult *result=nullptr, const QString &provider=QString())
Import the certificate from PEM format.
QCA::Certificate::constraints
Constraints constraints() const
The constraints that apply to this certificate.
QCA::Certificate::commonName
QString commonName() const
The common name of the subject of the certificate.
QCA::Certificate::isSelfSigned
bool isSelfSigned() const
Test if the Certificate is self-signed.
QCA::Certificate::subjectInfoOrdered
CertificateInfoOrdered subjectInfoOrdered() const
Properties of the subject of the certificate, as an ordered list (QList of CertificateInfoPair).
QCA::Certificate::Certificate
Certificate(const CertificateOptions &opts, const PrivateKey &key, const QString &provider=QString())
Create a Certificate with specified options and a specified private key.
QCA::Certificate::isCA
bool isCA() const
Test if the Certificate is valid as a Certificate Authority.
QCA::Certificate::operator!=
bool operator!=(const Certificate &other) const
Inequality operator.
Definition qca_cert.h:1176
QCA::Certificate::operator=
Certificate & operator=(const Certificate &from)
Standard assignment operator.
QCA::Certificate::change
void change(CertContext *c)
QCA::Certificate::fromDER
static Certificate fromDER(const QByteArray &a, ConvertResult *result=nullptr, const QString &provider=QString())
Import the certificate from DER.
QCA::Certificate::pathLimit
int pathLimit() const
The upper bound of the number of links in the certificate chain, if any.
QCA::Certificate::notValidBefore
QDateTime notValidBefore() const
The earliest date that the certificate is valid.
QCA::Certificate::issuerInfoOrdered
CertificateInfoOrdered issuerInfoOrdered() const
Properties of the issuer of the certificate, as an ordered list (QList of CertificateInfoPair).
QCA::Certificate::policies
QStringList policies() const
The policies that apply to this certificate.
QCA::Certificate::subjectPublicKey
PublicKey subjectPublicKey() const
The public key associated with the subject of the certificate.
QCA::Certificate::toPEM
QString toPEM() const
Export the Certificate into a PEM format.
QCA::Certificate::operator==
bool operator==(const Certificate &a) const
Test for equality of two certificates.
QCA::Certificate::issuerLocations
QStringList issuerLocations() const
List of URI locations for issuer certificate files.
QCA::Certificate::toPEMFile
bool toPEMFile(const QString &fileName) const
Export the Certificate into PEM format in a file.
QCA::Certificate::issuerKeyId
QByteArray issuerKeyId() const
The key identifier associated with the issuer.
QCA::Certificate::serialNumber
BigInteger serialNumber() const
The serial number of the certificate.
QCA::Certificate::Certificate
Certificate(const Certificate &from)
Standard copy constructor.
QCA::Certificate::fromPEMFile
static Certificate fromPEMFile(const QString &fileName, ConvertResult *result=nullptr, const QString &provider=QString())
Import the certificate from a file.
QCA::Certificate::Certificate
Certificate(const QString &fileName)
Create a Certificate from a PEM encoded file.
QCA::Certificate::notValidAfter
QDateTime notValidAfter() const
The latest date that the certificate is valid.
QCA::Certificate::validate
Validity validate(const CertificateCollection &trusted, const CertificateCollection &untrusted, UsageMode u=UsageAny, ValidateFlags vf=ValidateAll) const
Check the validity of a certificate.
QCA::Certificate::subjectKeyId
QByteArray subjectKeyId() const
The key identifier associated with the subject.
QCA::Certificate::subjectInfo
CertificateInfo subjectInfo() const
Properties of the subject of the certificate, as a QMultiMap.
QCA::Certificate::issuerInfo
CertificateInfo issuerInfo() const
Properties of the issuer of the certificate.
QCA::Certificate::ocspLocations
QStringList ocspLocations() const
List of URI locations for OCSP services.
QCA::Certificate::crlLocations
QStringList crlLocations() const
List of URI locations for CRL files.
QCA::Certificate::isNull
bool isNull() const
Test if the certificate is empty (null).
QCA::Certificate::Certificate
Certificate()
Create an empty Certificate.
QCA::Certificate::toDER
QByteArray toDER() const
Export the Certificate into a DER format.
QCA::Certificate::isIssuerOf
bool isIssuerOf(const Certificate &other) const
Test if the Certificate has signed another Certificate object and is therefore the issuer.
QCA::ConstraintType::id
QString id() const
The type as an identifier string.
QCA::ConstraintType::operator!=
bool operator!=(const ConstraintType &other) const
Inequality operator.
Definition qca_cert.h:469
QCA::ConstraintType::section
Section section() const
The section the constraint is part of.
QCA::ConstraintType::Section
Section
Section of the certificate that the constraint belongs in.
Definition qca_cert.h:370
QCA::ConstraintType::ExtendedKeyUsage
@ ExtendedKeyUsage
Stored in the extended key usage section.
Definition qca_cert.h:372
QCA::ConstraintType::KeyUsage
@ KeyUsage
Stored in the key usage section.
Definition qca_cert.h:371
QCA::ConstraintType::ConstraintType
ConstraintType(const ConstraintType &from)
Standard copy constructor.
QCA::ConstraintType::operator<
bool operator<(const ConstraintType &other) const
Comparison operator.
QCA::ConstraintType::known
ConstraintTypeKnown known() const
The type as part of the ConstraintTypeKnown enumerator.
QCA::ConstraintType::ConstraintType
ConstraintType(const QString &id, Section section)
Construct a new constraint.
QCA::ConstraintType::operator==
bool operator==(const ConstraintType &other) const
Comparison operator.
QCA::ConstraintType::operator=
ConstraintType & operator=(const ConstraintType &from)
Standard assignment operator.
QCA::ConstraintType::ConstraintType
ConstraintType()
Standard constructor.
QCA::ConstraintType::ConstraintType
ConstraintType(ConstraintTypeKnown known)
Construct a new constraint.
QCA::KeyBundle
Certificate chain and private key pair.
Definition qca_cert.h:2176
QCA::KeyBundle::KeyBundle
KeyBundle(const KeyBundle &from)
Standard copy constructor.
QCA::KeyBundle::KeyBundle
KeyBundle(const QString &fileName, const SecureArray &passphrase=SecureArray())
Create a KeyBundle from a PKCS12 (.p12) encoded file.
QCA::KeyBundle::certificateChain
CertificateChain certificateChain() const
The public certificate part of this bundle.
QCA::KeyBundle::setName
void setName(const QString &s)
Specify the name of this bundle.
QCA::KeyBundle::setCertificateChainAndKey
void setCertificateChainAndKey(const CertificateChain &c, const PrivateKey &key)
Set the public certificate and private key.
QCA::KeyBundle::fromFile
static KeyBundle fromFile(const QString &fileName, const SecureArray &passphrase=SecureArray(), ConvertResult *result=nullptr, const QString &provider=QString())
Import the key bundle from a file in PKCS12 (.p12) format.
QCA::KeyBundle::KeyBundle
KeyBundle()
Create an empty KeyBundle.
QCA::KeyBundle::privateKey
PrivateKey privateKey() const
The private key part of this bundle.
QCA::KeyBundle::name
QString name() const
The name associated with this key.
QCA::KeyBundle::toArray
QByteArray toArray(const SecureArray &passphrase, const QString &provider=QString()) const
Export the key bundle to an array in PKCS12 format.
QCA::KeyBundle::operator=
KeyBundle & operator=(const KeyBundle &from)
Standard assignment operator.
QCA::KeyBundle::isNull
bool isNull() const
Test if this key is empty (null).
QCA::KeyBundle::fromArray
static KeyBundle fromArray(const QByteArray &a, const SecureArray &passphrase=SecureArray(), ConvertResult *result=nullptr, const QString &provider=QString())
Import the key bundle from an array in PKCS12 format.
QCA::KeyBundle::toFile
bool toFile(const QString &fileName, const SecureArray &passphrase, const QString &provider=QString()) const
Export the key bundle to a file in PKCS12 (.p12) format.
QCA::KeyLoader::loadKeyBundleFromFile
void loadKeyBundleFromFile(const QString &fileName)
Initiate an asynchronous loading of a KeyBundle from a file.
QCA::KeyLoader::loadPrivateKeyFromDER
void loadPrivateKeyFromDER(const SecureArray &a)
Initiate an asynchronous loading of a PrivateKey from a DER format array.
QCA::KeyLoader::convertResult
ConvertResult convertResult() const
The result of the loading process.
QCA::KeyLoader::loadKeyBundleFromArray
void loadKeyBundleFromArray(const QByteArray &a)
Initiate an asynchronous loading of a KeyBundle from an array.
QCA::KeyLoader::loadPrivateKeyFromPEMFile
void loadPrivateKeyFromPEMFile(const QString &fileName)
Initiate an asynchronous loading of a PrivateKey from a PEM format file.
QCA::KeyLoader::loadPrivateKeyFromPEM
void loadPrivateKeyFromPEM(const QString &s)
Initiate an asynchronous loading of a PrivateKey from a PEM format string.
QCA::KeyLoader::keyBundle
KeyBundle keyBundle() const
The key bundle that has been loaded.
QCA::KeyLoader::privateKey
PrivateKey privateKey() const
The private key that has been loaded.
QCA::KeyLoader::finished
void finished()
Signal that is emitted when the load process has completed.
QCA::KeyLoader::KeyLoader
KeyLoader(QObject *parent=nullptr)
Create a KeyLoader object.
QCA::PGPKey::keyId
QString keyId() const
The Key identification for the PGP key.
QCA::PGPKey::primaryUserId
QString primaryUserId() const
The primary user identification for the key.
QCA::PGPKey::creationDate
QDateTime creationDate() const
The creation date for the key.
QCA::PGPKey::fromFile
static PGPKey fromFile(const QString &fileName, ConvertResult *result=nullptr, const QString &provider=QString())
Import the key from a file.
QCA::PGPKey::isTrusted
bool isTrusted() const
Test if the key is trusted.
QCA::PGPKey::fromString
static PGPKey fromString(const QString &s, ConvertResult *result=nullptr, const QString &provider=QString())
Import the key from a string.
QCA::PGPKey::isNull
bool isNull() const
Test if the PGP key is empty (null).
QCA::PGPKey::fingerprint
QString fingerprint() const
The key fingerpint.
QCA::PGPKey::toFile
bool toFile(const QString &fileName) const
Export the key to a file.
QCA::PGPKey::toArray
QByteArray toArray() const
Export the key to an array.
QCA::PGPKey::fromArray
static PGPKey fromArray(const QByteArray &a, ConvertResult *result=nullptr, const QString &provider=QString())
Import the key from an array.
QCA::PGPKey::PGPKey
PGPKey()
Create an empty PGP key.
QCA::PGPKey::toString
QString toString() const
Export the key to a string.
QCA::PGPKey::PGPKey
PGPKey(const QString &fileName)
Create a PGP key from an encoded file.
QCA::PGPKey::PGPKey
PGPKey(const PGPKey &from)
Standard copy constructor.
QCA::PGPKey::userIds
QStringList userIds() const
The list of all user identifications associated with the key.
QCA::PGPKey::expirationDate
QDateTime expirationDate() const
The expiration date for the key.
QCA::PGPKey::isSecret
bool isSecret() const
Test if the PGP key is the secret key.
QCA::PGPKey::inKeyring
bool inKeyring() const
Test if this key is in a keyring.
QCA::PGPKey::operator=
PGPKey & operator=(const PGPKey &from)
Standard assignment operator.
QCA::PrivateKey
Generic private key.
Definition qca_publickey.h:833
QCA::PublicKey
Generic public key.
Definition qca_publickey.h:529
QCA::SecureArray
Secure array of bytes.
Definition qca_tools.h:317
QList
QObject
QCA
QCA - the Qt Cryptographic Architecture.
Definition qca_basic.h:41
QCA::UsageMode
UsageMode
Specify the intended usage of a certificate.
Definition qca_cert.h:483
QCA::UsageTimeStamping
@ UsageTimeStamping
time stamping certificate
Definition qca_cert.h:489
QCA::UsageEmailProtection
@ UsageEmailProtection
email (S/MIME) certificate
Definition qca_cert.h:488
QCA::UsageCRLSigning
@ UsageCRLSigning
certificate revocation list signing certificate
Definition qca_cert.h:490
QCA::UsageTLSServer
@ UsageTLSServer
server side of a TLS or SSL connection
Definition qca_cert.h:485
QCA::UsageTLSClient
@ UsageTLSClient
client side of a TLS or SSL connection
Definition qca_cert.h:486
QCA::UsageAny
@ UsageAny
Any application, or unspecified.
Definition qca_cert.h:484
QCA::UsageCodeSigning
@ UsageCodeSigning
code signing certificate
Definition qca_cert.h:487
QCA::CertificateRequestFormat
CertificateRequestFormat
Certificate Request Format.
Definition qca_cert.h:54
QCA::SPKAC
@ SPKAC
Signed Public Key and Challenge (Netscape) format.
Definition qca_cert.h:56
QCA::PKCS10
@ PKCS10
standard PKCS#10 format
Definition qca_cert.h:55
QCA::Constraints
QList< ConstraintType > Constraints
Certificate constraints type
Definition qca_cert.h:590
QCA::ConstraintTypeKnown
ConstraintTypeKnown
Known types of certificate constraints.
Definition qca_cert.h:317
QCA::DataEncipherment
@ DataEncipherment
Certificate can be used for encrypting / decrypting data, id = "KeyUsage.dataEncipherment"
Definition qca_cert.h:322
QCA::IPSecUser
@ IPSecUser
Certificate can be used to authenticate a user in IPSEC, id = "1.3.6.1.5.5.7.3.7".
Definition qca_cert.h:342
QCA::EmailProtection
@ EmailProtection
Certificate can be used to sign / encrypt email, id = "1.3.6.1.5.5.7.3.4".
Definition qca_cert.h:336
QCA::CRLSign
@ CRLSign
Certificate can be used to sign Certificate Revocation Lists, id = "KeyUsage.crlSign"
Definition qca_cert.h:325
QCA::KeyAgreement
@ KeyAgreement
Certificate can be used for key agreement, id = "KeyUsage.keyAgreement"
Definition qca_cert.h:323
QCA::ClientAuth
@ ClientAuth
Certificate can be used for client authentication (e.g.
Definition qca_cert.h:332
QCA::IPSecEndSystem
@ IPSecEndSystem
Certificate can be used to authenticate a endpoint in IPSEC, id = "1.3.6.1.5.5.7.3....
Definition qca_cert.h:338
QCA::IPSecTunnel
@ IPSecTunnel
Certificate can be used to authenticate a tunnel in IPSEC, id = "1.3.6.1.5.5.7.3.6".
Definition qca_cert.h:340
QCA::ServerAuth
@ ServerAuth
Certificate can be used for server authentication (e.g.
Definition qca_cert.h:330
QCA::KeyEncipherment
@ KeyEncipherment
Certificate can be used for encrypting / decrypting keys, id = "KeyUsage.keyEncipherment"
Definition qca_cert.h:321
QCA::TimeStamping
@ TimeStamping
Certificate can be used to create a "time stamp" signature, id = "1.3.6.1.5.5.7.3....
Definition qca_cert.h:344
QCA::CodeSigning
@ CodeSigning
Certificate can be used to sign code, id = "1.3.6.1.5.5.7.3.3".
Definition qca_cert.h:334
QCA::EncipherOnly
@ EncipherOnly
Certificate can only be used for encryption, id = "KeyUsage.encipherOnly"
Definition qca_cert.h:326
QCA::OCSPSigning
@ OCSPSigning
Certificate can be used to sign an Online Certificate Status Protocol (OCSP) assertion,...
Definition qca_cert.h:346
QCA::NonRepudiation
@ NonRepudiation
Certificate can be used for non-repudiation, id = "KeyUsage.nonRepudiation"
Definition qca_cert.h:320
QCA::DecipherOnly
@ DecipherOnly
Certificate can only be used for decryption, id = "KeyUsage.decipherOnly"
Definition qca_cert.h:327
QCA::DigitalSignature
@ DigitalSignature
Certificate can be used to create digital signatures, id = "KeyUsage.digitalSignature"
Definition qca_cert.h:319
QCA::KeyCertificateSign
@ KeyCertificateSign
Certificate can be used for key certificate signing, id = "KeyUsage.keyCertSign"
Definition qca_cert.h:324
QCA::Validity
Validity
The validity (or otherwise) of a certificate.
Definition qca_cert.h:497
QCA::ErrorValidityUnknown
@ ErrorValidityUnknown
Validity is unknown.
Definition qca_cert.h:510
QCA::ErrorRevoked
@ ErrorRevoked
The certificate has been revoked.
Definition qca_cert.h:505
QCA::ErrorUntrusted
@ ErrorUntrusted
The certificate is not trusted.
Definition qca_cert.h:500
QCA::ErrorExpired
@ ErrorExpired
The certificate has expired, or is not yet valid (e.g.
Definition qca_cert.h:507
QCA::ErrorPathLengthExceeded
@ ErrorPathLengthExceeded
The path length from the root CA to this certificate is too long.
Definition qca_cert.h:506
QCA::ErrorSignatureFailed
@ ErrorSignatureFailed
The signature does not match.
Definition qca_cert.h:501
QCA::ErrorInvalidPurpose
@ ErrorInvalidPurpose
The purpose does not match the intended usage.
Definition qca_cert.h:503
QCA::ErrorExpiredCA
@ ErrorExpiredCA
The Certificate Authority has expired.
Definition qca_cert.h:509
QCA::ErrorSelfSigned
@ ErrorSelfSigned
The certificate is self-signed, and is not found in the list of trusted certificates.
Definition qca_cert.h:504
QCA::ErrorInvalidCA
@ ErrorInvalidCA
The Certificate Authority is invalid.
Definition qca_cert.h:502
QCA::ValidityGood
@ ValidityGood
The certificate is valid.
Definition qca_cert.h:498
QCA::ErrorRejected
@ ErrorRejected
The root CA rejected the certificate purpose.
Definition qca_cert.h:499
QCA::orderedToDNString
QCA_EXPORT QString orderedToDNString(const CertificateInfoOrdered &in)
Convert to RFC 1779 string format.
QCA::ValidateFlags
ValidateFlags
The conditions to validate for a certificate.
Definition qca_cert.h:517
QCA::orderedDNOnly
QCA_EXPORT CertificateInfoOrdered orderedDNOnly(const CertificateInfoOrdered &in)
Return a new CertificateInfoOrdered that only contains the Distinguished Name (DN) types found in the...
QCA::CertificateInfoTypeKnown
CertificateInfoTypeKnown
Known types of information stored in certificates.
Definition qca_cert.h:65
QCA::IncorporationCountry
@ IncorporationCountry
The country of incorporation (EV certificates), id = "1.3.6.1.4.1.311.60.2.1.3".
Definition qca_cert.h:76
QCA::CommonName
@ CommonName
The common name (eg person), id = "2.5.4.3".
Definition qca_cert.h:66
QCA::Country
@ Country
The country, id = "2.5.4.6".
Definition qca_cert.h:75
QCA::XMPP
@ XMPP
XMPP address (see http://www.ietf.org/rfc/rfc3920.txt), id = "1.3.6.1.5.5.7.8.5".
Definition qca_cert.h:80
QCA::Locality
@ Locality
The locality (eg city, a shire, or part of a state), id = "2.5.4.7".
Definition qca_cert.h:71
QCA::State
@ State
The state within the country, id = "2.5.4.8".
Definition qca_cert.h:73
QCA::Email
@ Email
Email address, id = "GeneralName.rfc822Name".
Definition qca_cert.h:67
QCA::IPAddress
@ IPAddress
IP address, id = "GeneralName.iPAddress".
Definition qca_cert.h:79
QCA::IncorporationLocality
@ IncorporationLocality
The locality of incorporation (EV certificates), id = "1.3.6.1.4.1.311.60.2.1.1".
Definition qca_cert.h:72
QCA::Organization
@ Organization
An organisation (eg company), id = "2.5.4.10".
Definition qca_cert.h:69
QCA::DNS
@ DNS
DNS name, id = "GeneralName.dNSName".
Definition qca_cert.h:78
QCA::EmailLegacy
@ EmailLegacy
PKCS#9 Email field, id = "1.2.840.113549.1.9.1".
Definition qca_cert.h:68
QCA::URI
@ URI
Uniform Resource Identifier, id = "GeneralName.uniformResourceIdentifier".
Definition qca_cert.h:77
QCA::IncorporationState
@ IncorporationState
The state of incorporation (EV certificates), id = "1.3.6.1.4.1.311.60.2.1.2".
Definition qca_cert.h:74
QCA::OrganizationalUnit
@ OrganizationalUnit
An part of an organisation (eg a division or branch), id = "2.5.4.11".
Definition qca_cert.h:70
QCA::ConvertResult
ConvertResult
Return value from a format conversion.
Definition qca_publickey.h:119
QCA::makeFriendlyNames
QCA_EXPORT QStringList makeFriendlyNames(const QList< Certificate > &list)
Create a list of unique friendly names among a list of certificates.
QCA::SignatureAlgorithm
SignatureAlgorithm
Signature algorithm variants.
Definition qca_publickey.h:74
QCA::CertificateInfo
QMultiMap< CertificateInfoType, QString > CertificateInfo
Certificate properties type.
Definition qca_cert.h:535
qca_core.h
Header file for core QCA infrastructure.
qca_publickey.h
Header file for PublicKey and PrivateKey related classes.