aheinecke@404: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik aheinecke@404: * Software engineering by Intevation GmbH aheinecke@404: * aheinecke@404: * This file is Free Software under the GNU GPL (v>=2) aheinecke@404: * and comes with ABSOLUTELY NO WARRANTY! aheinecke@404: * See LICENSE.txt for details. aheinecke@404: */ aheinecke@7: #ifndef CERTIFICATELIST_H aheinecke@7: #define CERTIFICATELIST_H andre@1255: andre@1255: class QByteArray; andre@1255: andre@1255: #include andre@1255: #include andre@1255: #include andre@1255: andre@1255: #include "listutil.h" andre@1255: #include "certificate.h" andre@1255: andre@1255: /** @brief Object representation of a certificate list andre@1255: * aheinecke@4: * This class handles a certificate list file. aheinecke@4: * It checks for the validity of that certificate aheinecke@4: * list file and provides an API for working with that aheinecke@4: * file. aheinecke@4: * aheinecke@4: * The List is parsed on Initialization. You should aheinecke@4: * check the Status afterwards to see if the file aheinecke@4: * could be parsed. aheinecke@4: * aheinecke@4: */ aheinecke@70: class CertificateList aheinecke@4: { aheinecke@4: public: aheinecke@70: CertificateList(); aheinecke@7: CertificateList(const char *fileName); aheinecke@4: aheinecke@7: list_status_t getStatus() {return mStatus;} aheinecke@25: aheinecke@70: /** @brief Read a list aheinecke@70: * aheinecke@70: * @param[in] fileName the filename of the list to read aheinecke@70: * aheinecke@70: * @return status of the read. Vaild on success. aheinecke@70: */ aheinecke@70: list_status_t readList(const char *fileName); aheinecke@70: andre@904: /** @brief Returns true if the list is Valid aheinecke@25: * aheinecke@25: * A list is valid only if the signature matched and the aheinecke@25: * list could be parsed. aheinecke@25: */ andre@26: bool isValid() const {return mStatus == Valid;} aheinecke@25: aheinecke@249: /* @brief get a list of certificate objects in this list */ aheinecke@249: const QList& getCertificates() const; aheinecke@4: aheinecke@84: /* @brief get the raw certificate list */ aheinecke@84: const QString& rawData() const {return mData;} aheinecke@84: aheinecke@255: /* @brief get the absolute filename of the certificate */ aheinecke@255: const QString& fileName() const {return mFileName;} aheinecke@255: rrenkert@455: /* @brief get the list date. */ rrenkert@455: const QDateTime& date() const {return mDate;} rrenkert@455: aheinecke@4: private: aheinecke@249: QList mCertificates; aheinecke@84: QString mData; aheinecke@249: QString mFileName; aheinecke@7: list_status_t mStatus; aheinecke@9: QDateTime mDate; aheinecke@7: }; aheinecke@7: #endif