diff --git a/include/QtCrypto/qca_cert.h b/include/QtCrypto/qca_cert.h index 829cfc02..04c8909d 100644 --- a/include/QtCrypto/qca_cert.h +++ b/include/QtCrypto/qca_cert.h @@ -190,7 +190,7 @@ namespace QCA /** Information on the subject of the certificate - \sa setIn + \sa setInfo */ CertificateInfo info() const; // request or create @@ -205,10 +205,10 @@ namespace QCA QStringList policies() const; // request or create /** - test if the certificate options include the certificate being a - certificate authority + test if the certificate is a CA cert \sa setAsCA + \sa setAsUser */ bool isCA() const; // request or create @@ -267,13 +267,17 @@ namespace QCA void setPolicies(const QStringList &policies); /** - set the certificate options to include the certificate being - a certificate authority + set the certificate to be a CA cert \param pathLimit the number of intermediate certificates allowable */ void setAsCA(int pathLimit = 8); // value from Botan + /** + set the certificate to be a user cert (this is the default) + */ + void setAsUser(); + /** Set the serial number property on this certificate diff --git a/src/qca_cert.cpp b/src/qca_cert.cpp index 6c2c4d61..64dea2dc 100644 --- a/src/qca_cert.cpp +++ b/src/qca_cert.cpp @@ -171,6 +171,12 @@ void CertificateOptions::setAsCA(int pathLimit) d->pathLimit = pathLimit; } +void CertificateOptions::setAsUser() +{ + d->isCA = false; + d->pathLimit = 0; +} + void CertificateOptions::setSerialNumber(const QBigInteger &i) { d->serial = i;