Mercurial > trustbridge
diff ui/certificate.h @ 349:a49766196a7d
Add certificateFromFile method
Currently untested
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 10 Apr 2014 15:08:54 +0200 |
parents | 36c68dfb821d |
children | 5f1494fab517 |
line wrap: on
line diff
--- a/ui/certificate.h Thu Apr 10 14:14:56 2014 +0200 +++ b/ui/certificate.h Thu Apr 10 15:08:54 2014 +0200 @@ -36,6 +36,12 @@ **/ Certificate(const QString& b64Line = QString()); + /** @brief construct a certificate from a byte array of DER data + * + * @param[in] derData a der encoded certificate. + **/ + Certificate(const QByteArray& derData); + /** @brief check if this certificate could be parsed */ bool isValid() const {return mValid;} @@ -88,6 +94,18 @@ /** @brief get the date the certificate expires */ QDateTime validTo() const {return mValidTo;} + /** @brief construct certificate objects from a file + * + * Constructs a new Certificate Object from a file containing either + * one DER encoded certificate or one or many PEM certificates. + * If no certificate could be parsed from that file an empty list is + * returned. + * + * The size restrictions for the certificate list file also apply + * for this file. + **/ + static QList<Certificate> fromFileName (const QString& file_name); + private: /** @brief Helper function to parse the details of a certificate **/ void parseDetails(const QByteArray& cert);