2019-01-05 22:30:25 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2018 by Chinmoy Ranjan Pradhan <chinmoyrp65@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2019-07-14 07:12:06 +00:00
|
|
|
#ifndef _OKULAR_GENERATOR_PDF_SIGNATUREUTILS_H_
|
|
|
|
#define _OKULAR_GENERATOR_PDF_SIGNATUREUTILS_H_
|
2019-01-05 22:30:25 +00:00
|
|
|
|
|
|
|
#include <poppler-form.h>
|
|
|
|
|
|
|
|
#include "core/signatureutils.h"
|
|
|
|
|
|
|
|
#include <config-okular-poppler.h>
|
|
|
|
|
|
|
|
class PopplerCertificateInfo : public Okular::CertificateInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PopplerCertificateInfo(const Poppler::CertificateInfo &info);
|
2019-12-18 11:51:13 +00:00
|
|
|
~PopplerCertificateInfo() override;
|
2019-01-05 22:30:25 +00:00
|
|
|
|
|
|
|
bool isNull() const override;
|
|
|
|
int version() const override;
|
|
|
|
QByteArray serialNumber() const override;
|
|
|
|
QString issuerInfo(EntityInfoKey) const override;
|
|
|
|
QString subjectInfo(EntityInfoKey) const override;
|
|
|
|
QDateTime validityStart() const override;
|
|
|
|
QDateTime validityEnd() const override;
|
|
|
|
KeyUsageExtensions keyUsageExtensions() const override;
|
|
|
|
QByteArray publicKey() const override;
|
|
|
|
PublicKeyType publicKeyType() const override;
|
|
|
|
int publicKeyStrength() const override;
|
|
|
|
bool isSelfSigned() const override;
|
|
|
|
QByteArray certificateData() const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Poppler::CertificateInfo m_info;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PopplerSignatureInfo : public Okular::SignatureInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PopplerSignatureInfo(const Poppler::SignatureValidationInfo &info);
|
2019-12-18 11:51:13 +00:00
|
|
|
~PopplerSignatureInfo() override;
|
2019-01-05 22:30:25 +00:00
|
|
|
|
|
|
|
SignatureStatus signatureStatus() const override;
|
|
|
|
CertificateStatus certificateStatus() const override;
|
|
|
|
QString signerName() const override;
|
|
|
|
QString signerSubjectDN() const override;
|
|
|
|
QString location() const override;
|
|
|
|
QString reason() const override;
|
|
|
|
HashAlgorithm hashAlgorithm() const override;
|
|
|
|
QDateTime signingTime() const override;
|
|
|
|
QByteArray signature() const override;
|
|
|
|
QList<qint64> signedRangeBounds() const override;
|
|
|
|
bool signsTotalDocument() const override;
|
|
|
|
const Okular::CertificateInfo &certificateInfo() const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Poppler::SignatureValidationInfo m_info;
|
|
|
|
Okular::CertificateInfo *m_certfiticateInfo;
|
|
|
|
};
|
|
|
|
|
2019-12-11 09:44:55 +00:00
|
|
|
#ifdef HAVE_POPPLER_SIGNING
|
|
|
|
|
|
|
|
class PopplerCertificateStore : public Okular::CertificateStore
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PopplerCertificateStore();
|
|
|
|
~PopplerCertificateStore();
|
|
|
|
|
|
|
|
QList<Okular::CertificateInfo*> getSigningCertificates() const override;
|
|
|
|
//QList<PopplerCertificateInfo*> getSigningCertificates() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2019-01-05 22:30:25 +00:00
|
|
|
#endif
|