Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
/*
|
|
|
|
verificationresult.cpp - wraps a gpgme verify result
|
|
|
|
Copyright (C) 2004 Klarälvdalens Datakonsult AB
|
|
|
|
|
|
|
|
This file is part of GPGME++.
|
|
|
|
|
|
|
|
GPGME++ is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
GPGME++ 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 Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public License
|
|
|
|
along with GPGME++; see the file COPYING.LIB. If not, write to the
|
|
|
|
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
cpp, qt: Include config.h
lang/cpp/src/callbacks.cpp,
lang/cpp/src/configuration.cpp,
lang/cpp/src/context.cpp,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/exception.cpp,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/importresult.cpp,
lang/cpp/src/key.cpp,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/tofuinfo.cpp,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/vfsmountresult.cpp,
lang/qt/src/dataprovider.cpp,
lang/qt/src/defaultkeygenerationjob.cpp,
lang/qt/src/gpgme_backend_debug.cpp,
lang/qt/src/job.cpp,
lang/qt/src/qgpgmeadduseridjob.cpp,
lang/qt/src/qgpgmebackend.cpp,
lang/qt/src/qgpgmechangeexpiryjob.cpp,
lang/qt/src/qgpgmechangeownertrustjob.cpp,
lang/qt/src/qgpgmechangepasswdjob.cpp,
lang/qt/src/qgpgmedecryptjob.cpp,
lang/qt/src/qgpgmedecryptverifyjob.cpp,
lang/qt/src/qgpgmedeletejob.cpp,
lang/qt/src/qgpgmedownloadjob.cpp,
lang/qt/src/qgpgmeencryptjob.cpp,
lang/qt/src/qgpgmeexportjob.cpp,
lang/qt/src/qgpgmeimportfromkeyserverjob.cpp,
lang/qt/src/qgpgmeimportjob.cpp,
lang/qt/src/qgpgmekeyformailboxjob.cpp,
lang/qt/src/qgpgmekeygenerationjob.cpp,
lang/qt/src/qgpgmekeylistjob.cpp,
lang/qt/src/qgpgmelistallkeysjob.cpp,
lang/qt/src/qgpgmenewcryptoconfig.cpp,
lang/qt/src/qgpgmerefreshkeysjob.cpp,
lang/qt/src/qgpgmesecretkeyexportjob.cpp,
lang/qt/src/qgpgmesignencryptjob.cpp,
lang/qt/src/qgpgmesignjob.cpp,
lang/qt/src/qgpgmesignkeyjob.cpp,
lang/qt/src/qgpgmetofupolicyjob.cpp,
lang/qt/src/qgpgmeverifydetachedjob.cpp,
lang/qt/src/qgpgmeverifyopaquejob.cpp,
lang/qt/src/qgpgmewkspublishjob.cpp,
lang/qt/src/threadedjobmixin.cpp,
lang/qt/tests/run-keyformailboxjob.cpp,
lang/qt/tests/t-encrypt.cpp,
lang/qt/tests/t-keylist.cpp,
lang/qt/tests/t-keylocate.cpp,
lang/qt/tests/t-ownertrust.cpp,
lang/qt/tests/t-support.cpp,
lang/qt/tests/t-tofuinfo.cpp,
lang/qt/tests/t-wkspublish.cpp: Include config.h
--
This fixes problems with mismatching definitions. Most
notably _FILE_OFFSET_BITS is now always set correctly.
2016-09-23 13:22:29 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
#include <verificationresult.h>
|
|
|
|
#include <notation.h>
|
|
|
|
#include "result_p.h"
|
|
|
|
#include "util.h"
|
2016-08-24 11:59:37 +00:00
|
|
|
#include "key.h"
|
2016-10-10 15:38:43 +00:00
|
|
|
#include "context.h"
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
|
|
|
|
#include <gpgme.h>
|
|
|
|
|
|
|
|
#include <istream>
|
|
|
|
#include <algorithm>
|
|
|
|
#include <iterator>
|
|
|
|
#include <string>
|
|
|
|
#include <cstring>
|
|
|
|
#include <cstdlib>
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
class GpgME::VerificationResult::Private
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit Private(const gpgme_verify_result_t r)
|
|
|
|
{
|
|
|
|
if (!r) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (r->file_name) {
|
|
|
|
file_name = r->file_name;
|
|
|
|
}
|
|
|
|
// copy recursively, using compiler-generated copy ctor.
|
|
|
|
// We just need to handle the pointers in the structs:
|
|
|
|
for (gpgme_signature_t is = r->signatures ; is ; is = is->next) {
|
|
|
|
gpgme_signature_t scopy = new _gpgme_signature(*is);
|
|
|
|
if (is->fpr) {
|
|
|
|
scopy->fpr = strdup(is->fpr);
|
|
|
|
}
|
|
|
|
// PENDING(marc) why does this crash on Windows in strdup()?
|
|
|
|
# ifndef _WIN32
|
|
|
|
if (is->pka_address) {
|
|
|
|
scopy->pka_address = strdup(is->pka_address);
|
|
|
|
}
|
|
|
|
# else
|
|
|
|
scopy->pka_address = 0;
|
|
|
|
# endif
|
|
|
|
scopy->next = 0;
|
|
|
|
sigs.push_back(scopy);
|
2016-08-24 11:59:37 +00:00
|
|
|
// copy keys
|
|
|
|
if (scopy->key) {
|
|
|
|
keys.push_back(Key(scopy->key, true));
|
2016-10-10 15:36:41 +00:00
|
|
|
} else {
|
|
|
|
keys.push_back(Key());
|
2016-08-24 11:59:37 +00:00
|
|
|
}
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
// copy notations:
|
|
|
|
nota.push_back(std::vector<Nota>());
|
|
|
|
purls.push_back(0);
|
|
|
|
for (gpgme_sig_notation_t in = is->notations ; in ; in = in->next) {
|
|
|
|
if (!in->name) {
|
|
|
|
if (in->value) {
|
|
|
|
purls.back() = strdup(in->value); // policy url
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
Nota n = { 0, 0, in->flags };
|
|
|
|
n.name = strdup(in->name);
|
|
|
|
if (in->value) {
|
|
|
|
n.value = strdup(in->value);
|
|
|
|
}
|
|
|
|
nota.back().push_back(n);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
~Private()
|
|
|
|
{
|
|
|
|
for (std::vector<gpgme_signature_t>::iterator it = sigs.begin() ; it != sigs.end() ; ++it) {
|
|
|
|
std::free((*it)->fpr);
|
|
|
|
std::free((*it)->pka_address);
|
|
|
|
delete *it; *it = 0;
|
|
|
|
}
|
|
|
|
for (std::vector< std::vector<Nota> >::iterator it = nota.begin() ; it != nota.end() ; ++it) {
|
|
|
|
for (std::vector<Nota>::iterator jt = it->begin() ; jt != it->end() ; ++jt) {
|
|
|
|
std::free(jt->name); jt->name = 0;
|
|
|
|
std::free(jt->value); jt->value = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
std::for_each(purls.begin(), purls.end(), &std::free);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Nota {
|
|
|
|
char *name;
|
|
|
|
char *value;
|
|
|
|
gpgme_sig_notation_flags_t flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<gpgme_signature_t> sigs;
|
|
|
|
std::vector< std::vector<Nota> > nota;
|
2016-08-24 11:59:37 +00:00
|
|
|
std::vector<GpgME::Key> keys;
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
std::vector<char *> purls;
|
|
|
|
std::string file_name;
|
2016-10-10 15:38:43 +00:00
|
|
|
Protocol proto;
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GpgME::VerificationResult::VerificationResult(gpgme_ctx_t ctx, int error)
|
|
|
|
: GpgME::Result(error), d()
|
|
|
|
{
|
|
|
|
init(ctx);
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::VerificationResult::VerificationResult(gpgme_ctx_t ctx, const Error &error)
|
|
|
|
: GpgME::Result(error), d()
|
|
|
|
{
|
|
|
|
init(ctx);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GpgME::VerificationResult::init(gpgme_ctx_t ctx)
|
|
|
|
{
|
|
|
|
if (!ctx) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
gpgme_verify_result_t res = gpgme_op_verify_result(ctx);
|
|
|
|
if (!res) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
d.reset(new Private(res));
|
2016-10-10 15:38:43 +00:00
|
|
|
gpgme_protocol_t proto = gpgme_get_protocol(ctx);
|
|
|
|
d->proto = proto == GPGME_PROTOCOL_OpenPGP ? OpenPGP :
|
|
|
|
proto == GPGME_PROTOCOL_CMS ? CMS :
|
|
|
|
UnknownProtocol;
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
make_standard_stuff(VerificationResult)
|
|
|
|
|
|
|
|
const char *GpgME::VerificationResult::fileName() const
|
|
|
|
{
|
|
|
|
return d ? d->file_name.c_str() : 0 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int GpgME::VerificationResult::numSignatures() const
|
|
|
|
{
|
|
|
|
return d ? d->sigs.size() : 0 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::Signature GpgME::VerificationResult::signature(unsigned int idx) const
|
|
|
|
{
|
|
|
|
return Signature(d, idx);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<GpgME::Signature> GpgME::VerificationResult::signatures() const
|
|
|
|
{
|
|
|
|
if (!d) {
|
|
|
|
return std::vector<Signature>();
|
|
|
|
}
|
|
|
|
std::vector<Signature> result;
|
|
|
|
result.reserve(d->sigs.size());
|
|
|
|
for (unsigned int i = 0 ; i < d->sigs.size() ; ++i) {
|
|
|
|
result.push_back(Signature(d, i));
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
Cpp / Qt: Reduce boost usage (memory and tuple)
* cpp/src/assuanresult.h,
cpp/src/configuration.cpp,
cpp/src/configuration.h,
cpp/src/data.h,
cpp/src/decryptionresult.h,
cpp/src/defaultassuantransaction.cpp,
cpp/src/encryptionresult.cpp,
cpp/src/encryptionresult.h,
cpp/src/engineinfo.h,
cpp/src/gpgagentgetinfoassuantransaction.cpp,
cpp/src/gpgsignkeyeditinteractor.cpp,
cpp/src/importresult.cpp,
cpp/src/importresult.h,
cpp/src/key.h,
cpp/src/keygenerationresult.h,
cpp/src/keylistresult.h,
cpp/src/notation.h,
cpp/src/signingresult.cpp,
cpp/src/signingresult.h,
cpp/src/verificationresult.cpp,
cpp/src/verificationresult.h,
cpp/src/vfsmountresult.h,
qt/src/dataprovider.cpp,
qt/src/dataprovider.h,
qt/src/decryptjob.h,
qt/src/decryptverifyjob.h,
qt/src/downloadjob.h,
qt/src/encryptjob.h,
qt/src/qgpgmeadduseridjob.cpp,
qt/src/qgpgmechangeexpiryjob.cpp,
qt/src/qgpgmechangeownertrustjob.cpp,
qt/src/qgpgmechangepasswdjob.cpp,
qt/src/qgpgmedecryptjob.cpp,
qt/src/qgpgmedecryptjob.h,
qt/src/qgpgmedecryptverifyjob.cpp,
qt/src/qgpgmedecryptverifyjob.h,
qt/src/qgpgmedeletejob.cpp,
qt/src/qgpgmedownloadjob.cpp,
qt/src/qgpgmedownloadjob.h,
qt/src/qgpgmeencryptjob.cpp,
qt/src/qgpgmeencryptjob.h,
qt/src/qgpgmeexportjob.cpp,
qt/src/qgpgmeexportjob.h,
qt/src/qgpgmeimportfromkeyserverjob.cpp,
qt/src/qgpgmeimportfromkeyserverjob.h,
qt/src/qgpgmeimportjob.cpp,
qt/src/qgpgmeimportjob.h,
qt/src/qgpgmekeygenerationjob.cpp,
qt/src/qgpgmekeygenerationjob.h,
qt/src/qgpgmekeylistjob.cpp,
qt/src/qgpgmekeylistjob.h,
qt/src/qgpgmelistallkeysjob.cpp,
qt/src/qgpgmelistallkeysjob.h,
qt/src/qgpgmenewcryptoconfig.cpp,
qt/src/qgpgmenewcryptoconfig.h,
qt/src/qgpgmesignencryptjob.cpp,
qt/src/qgpgmesignencryptjob.h,
qt/src/qgpgmesignjob.cpp,
qt/src/qgpgmesignjob.h,
qt/src/qgpgmesignkeyjob.cpp,
qt/src/qgpgmeverifydetachedjob.cpp,
qt/src/qgpgmeverifydetachedjob.h,
qt/src/qgpgmeverifyopaquejob.cpp,
qt/src/qgpgmeverifyopaquejob.h,
qt/src/signencryptjob.h,
qt/src/signjob.h,
qt/src/threadedjobmixin.h,
qt/src/verifydetachedjob.h,
qt/src/verifyopaquejob.h: Reduce boost usage.
--
This was mostly done with search and replace to change the
templates / classes from memory and tuple to their c++11
equivalents.
2016-04-03 12:52:16 +00:00
|
|
|
GpgME::Signature::Signature(const std::shared_ptr<VerificationResult::Private> &parent, unsigned int i)
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
: d(parent), idx(i)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::Signature::Signature() : d(), idx(0) {}
|
|
|
|
|
|
|
|
bool GpgME::Signature::isNull() const
|
|
|
|
{
|
|
|
|
return !d || idx >= d->sigs.size() ;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::Signature::Summary GpgME::Signature::summary() const
|
|
|
|
{
|
|
|
|
if (isNull()) {
|
|
|
|
return None;
|
|
|
|
}
|
|
|
|
gpgme_sigsum_t sigsum = d->sigs[idx]->summary;
|
|
|
|
unsigned int result = 0;
|
|
|
|
if (sigsum & GPGME_SIGSUM_VALID) {
|
|
|
|
result |= Valid;
|
|
|
|
}
|
|
|
|
if (sigsum & GPGME_SIGSUM_GREEN) {
|
|
|
|
result |= Green;
|
|
|
|
}
|
|
|
|
if (sigsum & GPGME_SIGSUM_RED) {
|
|
|
|
result |= Red;
|
|
|
|
}
|
|
|
|
if (sigsum & GPGME_SIGSUM_KEY_REVOKED) {
|
|
|
|
result |= KeyRevoked;
|
|
|
|
}
|
|
|
|
if (sigsum & GPGME_SIGSUM_KEY_EXPIRED) {
|
|
|
|
result |= KeyExpired;
|
|
|
|
}
|
|
|
|
if (sigsum & GPGME_SIGSUM_SIG_EXPIRED) {
|
|
|
|
result |= SigExpired;
|
|
|
|
}
|
|
|
|
if (sigsum & GPGME_SIGSUM_KEY_MISSING) {
|
|
|
|
result |= KeyMissing;
|
|
|
|
}
|
|
|
|
if (sigsum & GPGME_SIGSUM_CRL_MISSING) {
|
|
|
|
result |= CrlMissing;
|
|
|
|
}
|
|
|
|
if (sigsum & GPGME_SIGSUM_CRL_TOO_OLD) {
|
|
|
|
result |= CrlTooOld;
|
|
|
|
}
|
|
|
|
if (sigsum & GPGME_SIGSUM_BAD_POLICY) {
|
|
|
|
result |= BadPolicy;
|
|
|
|
}
|
|
|
|
if (sigsum & GPGME_SIGSUM_SYS_ERROR) {
|
|
|
|
result |= SysError;
|
|
|
|
}
|
2016-07-04 09:31:01 +00:00
|
|
|
if (sigsum & GPGME_SIGSUM_TOFU_CONFLICT) {
|
|
|
|
result |= TofuConflict;
|
|
|
|
}
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
return static_cast<Summary>(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *GpgME::Signature::fingerprint() const
|
|
|
|
{
|
|
|
|
return isNull() ? 0 : d->sigs[idx]->fpr ;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::Error GpgME::Signature::status() const
|
|
|
|
{
|
|
|
|
return Error(isNull() ? 0 : d->sigs[idx]->status);
|
|
|
|
}
|
|
|
|
|
|
|
|
time_t GpgME::Signature::creationTime() const
|
|
|
|
{
|
|
|
|
return static_cast<time_t>(isNull() ? 0 : d->sigs[idx]->timestamp);
|
|
|
|
}
|
|
|
|
|
|
|
|
time_t GpgME::Signature::expirationTime() const
|
|
|
|
{
|
|
|
|
return static_cast<time_t>(isNull() ? 0 : d->sigs[idx]->exp_timestamp);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GpgME::Signature::neverExpires() const
|
|
|
|
{
|
|
|
|
return expirationTime() == (time_t)0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GpgME::Signature::isWrongKeyUsage() const
|
|
|
|
{
|
|
|
|
return !isNull() && d->sigs[idx]->wrong_key_usage;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GpgME::Signature::isVerifiedUsingChainModel() const
|
|
|
|
{
|
|
|
|
return !isNull() && d->sigs[idx]->chain_model;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::Signature::PKAStatus GpgME::Signature::pkaStatus() const
|
|
|
|
{
|
|
|
|
if (!isNull()) {
|
|
|
|
return static_cast<PKAStatus>(d->sigs[idx]->pka_trust);
|
|
|
|
}
|
|
|
|
return UnknownPKAStatus;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *GpgME::Signature::pkaAddress() const
|
|
|
|
{
|
|
|
|
if (!isNull()) {
|
|
|
|
return d->sigs[idx]->pka_address;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::Signature::Validity GpgME::Signature::validity() const
|
|
|
|
{
|
|
|
|
if (isNull()) {
|
|
|
|
return Unknown;
|
|
|
|
}
|
|
|
|
switch (d->sigs[idx]->validity) {
|
|
|
|
default:
|
|
|
|
case GPGME_VALIDITY_UNKNOWN: return Unknown;
|
|
|
|
case GPGME_VALIDITY_UNDEFINED: return Undefined;
|
|
|
|
case GPGME_VALIDITY_NEVER: return Never;
|
|
|
|
case GPGME_VALIDITY_MARGINAL: return Marginal;
|
|
|
|
case GPGME_VALIDITY_FULL: return Full;
|
|
|
|
case GPGME_VALIDITY_ULTIMATE: return Ultimate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
char GpgME::Signature::validityAsString() const
|
|
|
|
{
|
|
|
|
if (isNull()) {
|
|
|
|
return '?';
|
|
|
|
}
|
|
|
|
switch (d->sigs[idx]->validity) {
|
|
|
|
default:
|
|
|
|
case GPGME_VALIDITY_UNKNOWN: return '?';
|
|
|
|
case GPGME_VALIDITY_UNDEFINED: return 'q';
|
|
|
|
case GPGME_VALIDITY_NEVER: return 'n';
|
|
|
|
case GPGME_VALIDITY_MARGINAL: return 'm';
|
|
|
|
case GPGME_VALIDITY_FULL: return 'f';
|
|
|
|
case GPGME_VALIDITY_ULTIMATE: return 'u';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::Error GpgME::Signature::nonValidityReason() const
|
|
|
|
{
|
|
|
|
return Error(isNull() ? 0 : d->sigs[idx]->validity_reason);
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int GpgME::Signature::publicKeyAlgorithm() const
|
|
|
|
{
|
|
|
|
if (!isNull()) {
|
|
|
|
return d->sigs[idx]->pubkey_algo;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *GpgME::Signature::publicKeyAlgorithmAsString() const
|
|
|
|
{
|
|
|
|
if (!isNull()) {
|
|
|
|
return gpgme_pubkey_algo_name(d->sigs[idx]->pubkey_algo);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int GpgME::Signature::hashAlgorithm() const
|
|
|
|
{
|
|
|
|
if (!isNull()) {
|
|
|
|
return d->sigs[idx]->hash_algo;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *GpgME::Signature::hashAlgorithmAsString() const
|
|
|
|
{
|
|
|
|
if (!isNull()) {
|
|
|
|
return gpgme_hash_algo_name(d->sigs[idx]->hash_algo);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *GpgME::Signature::policyURL() const
|
|
|
|
{
|
|
|
|
return isNull() ? 0 : d->purls[idx] ;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::Notation GpgME::Signature::notation(unsigned int nidx) const
|
|
|
|
{
|
|
|
|
return GpgME::Notation(d, idx, nidx);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<GpgME::Notation> GpgME::Signature::notations() const
|
|
|
|
{
|
|
|
|
if (isNull()) {
|
|
|
|
return std::vector<GpgME::Notation>();
|
|
|
|
}
|
|
|
|
std::vector<GpgME::Notation> result;
|
|
|
|
result.reserve(d->nota[idx].size());
|
|
|
|
for (unsigned int i = 0 ; i < d->nota[idx].size() ; ++i) {
|
|
|
|
result.push_back(GpgME::Notation(d, idx, i));
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2016-08-24 11:59:37 +00:00
|
|
|
GpgME::Key GpgME::Signature::key() const
|
|
|
|
{
|
|
|
|
if (isNull()) {
|
|
|
|
return Key();
|
|
|
|
}
|
|
|
|
return d->keys[idx];
|
|
|
|
}
|
|
|
|
|
2016-10-10 15:38:43 +00:00
|
|
|
GpgME::Key GpgME::Signature::key(bool search, bool update) const
|
|
|
|
{
|
|
|
|
if (isNull()) {
|
|
|
|
return Key();
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::Key ret = key();
|
|
|
|
if (ret.isNull() && search) {
|
|
|
|
auto ctx = Context::createForProtocol (d->proto);
|
|
|
|
if (ctx) {
|
|
|
|
ctx->setKeyListMode(KeyListMode::Local |
|
|
|
|
KeyListMode::Signatures |
|
|
|
|
KeyListMode::SignatureNotations |
|
|
|
|
KeyListMode::Validate |
|
|
|
|
KeyListMode::WithTofu);
|
|
|
|
Error e;
|
|
|
|
ret = d->keys[idx] = ctx->key(fingerprint(), e, false);
|
|
|
|
delete ctx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (update) {
|
2016-12-15 10:24:43 +00:00
|
|
|
d->keys[idx].update();
|
|
|
|
ret = d->keys[idx];
|
2016-10-10 15:38:43 +00:00
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
class GpgME::Notation::Private
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Private() : d(), sidx(0), nidx(0), nota(0) {}
|
Cpp / Qt: Reduce boost usage (memory and tuple)
* cpp/src/assuanresult.h,
cpp/src/configuration.cpp,
cpp/src/configuration.h,
cpp/src/data.h,
cpp/src/decryptionresult.h,
cpp/src/defaultassuantransaction.cpp,
cpp/src/encryptionresult.cpp,
cpp/src/encryptionresult.h,
cpp/src/engineinfo.h,
cpp/src/gpgagentgetinfoassuantransaction.cpp,
cpp/src/gpgsignkeyeditinteractor.cpp,
cpp/src/importresult.cpp,
cpp/src/importresult.h,
cpp/src/key.h,
cpp/src/keygenerationresult.h,
cpp/src/keylistresult.h,
cpp/src/notation.h,
cpp/src/signingresult.cpp,
cpp/src/signingresult.h,
cpp/src/verificationresult.cpp,
cpp/src/verificationresult.h,
cpp/src/vfsmountresult.h,
qt/src/dataprovider.cpp,
qt/src/dataprovider.h,
qt/src/decryptjob.h,
qt/src/decryptverifyjob.h,
qt/src/downloadjob.h,
qt/src/encryptjob.h,
qt/src/qgpgmeadduseridjob.cpp,
qt/src/qgpgmechangeexpiryjob.cpp,
qt/src/qgpgmechangeownertrustjob.cpp,
qt/src/qgpgmechangepasswdjob.cpp,
qt/src/qgpgmedecryptjob.cpp,
qt/src/qgpgmedecryptjob.h,
qt/src/qgpgmedecryptverifyjob.cpp,
qt/src/qgpgmedecryptverifyjob.h,
qt/src/qgpgmedeletejob.cpp,
qt/src/qgpgmedownloadjob.cpp,
qt/src/qgpgmedownloadjob.h,
qt/src/qgpgmeencryptjob.cpp,
qt/src/qgpgmeencryptjob.h,
qt/src/qgpgmeexportjob.cpp,
qt/src/qgpgmeexportjob.h,
qt/src/qgpgmeimportfromkeyserverjob.cpp,
qt/src/qgpgmeimportfromkeyserverjob.h,
qt/src/qgpgmeimportjob.cpp,
qt/src/qgpgmeimportjob.h,
qt/src/qgpgmekeygenerationjob.cpp,
qt/src/qgpgmekeygenerationjob.h,
qt/src/qgpgmekeylistjob.cpp,
qt/src/qgpgmekeylistjob.h,
qt/src/qgpgmelistallkeysjob.cpp,
qt/src/qgpgmelistallkeysjob.h,
qt/src/qgpgmenewcryptoconfig.cpp,
qt/src/qgpgmenewcryptoconfig.h,
qt/src/qgpgmesignencryptjob.cpp,
qt/src/qgpgmesignencryptjob.h,
qt/src/qgpgmesignjob.cpp,
qt/src/qgpgmesignjob.h,
qt/src/qgpgmesignkeyjob.cpp,
qt/src/qgpgmeverifydetachedjob.cpp,
qt/src/qgpgmeverifydetachedjob.h,
qt/src/qgpgmeverifyopaquejob.cpp,
qt/src/qgpgmeverifyopaquejob.h,
qt/src/signencryptjob.h,
qt/src/signjob.h,
qt/src/threadedjobmixin.h,
qt/src/verifydetachedjob.h,
qt/src/verifyopaquejob.h: Reduce boost usage.
--
This was mostly done with search and replace to change the
templates / classes from memory and tuple to their c++11
equivalents.
2016-04-03 12:52:16 +00:00
|
|
|
Private(const std::shared_ptr<VerificationResult::Private> &priv, unsigned int sindex, unsigned int nindex)
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
: d(priv), sidx(sindex), nidx(nindex), nota(0)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
Private(gpgme_sig_notation_t n)
|
|
|
|
: d(), sidx(0), nidx(0), nota(n ? new _gpgme_sig_notation(*n) : 0)
|
|
|
|
{
|
|
|
|
if (nota && nota->name) {
|
|
|
|
nota->name = strdup(nota->name);
|
|
|
|
}
|
|
|
|
if (nota && nota->value) {
|
|
|
|
nota->value = strdup(nota->value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Private(const Private &other)
|
|
|
|
: d(other.d), sidx(other.sidx), nidx(other.nidx), nota(other.nota)
|
|
|
|
{
|
|
|
|
if (nota) {
|
|
|
|
nota->name = strdup(nota->name);
|
|
|
|
nota->value = strdup(nota->value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
~Private()
|
|
|
|
{
|
|
|
|
if (nota) {
|
|
|
|
std::free(nota->name); nota->name = 0;
|
|
|
|
std::free(nota->value); nota->value = 0;
|
|
|
|
delete nota;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Cpp / Qt: Reduce boost usage (memory and tuple)
* cpp/src/assuanresult.h,
cpp/src/configuration.cpp,
cpp/src/configuration.h,
cpp/src/data.h,
cpp/src/decryptionresult.h,
cpp/src/defaultassuantransaction.cpp,
cpp/src/encryptionresult.cpp,
cpp/src/encryptionresult.h,
cpp/src/engineinfo.h,
cpp/src/gpgagentgetinfoassuantransaction.cpp,
cpp/src/gpgsignkeyeditinteractor.cpp,
cpp/src/importresult.cpp,
cpp/src/importresult.h,
cpp/src/key.h,
cpp/src/keygenerationresult.h,
cpp/src/keylistresult.h,
cpp/src/notation.h,
cpp/src/signingresult.cpp,
cpp/src/signingresult.h,
cpp/src/verificationresult.cpp,
cpp/src/verificationresult.h,
cpp/src/vfsmountresult.h,
qt/src/dataprovider.cpp,
qt/src/dataprovider.h,
qt/src/decryptjob.h,
qt/src/decryptverifyjob.h,
qt/src/downloadjob.h,
qt/src/encryptjob.h,
qt/src/qgpgmeadduseridjob.cpp,
qt/src/qgpgmechangeexpiryjob.cpp,
qt/src/qgpgmechangeownertrustjob.cpp,
qt/src/qgpgmechangepasswdjob.cpp,
qt/src/qgpgmedecryptjob.cpp,
qt/src/qgpgmedecryptjob.h,
qt/src/qgpgmedecryptverifyjob.cpp,
qt/src/qgpgmedecryptverifyjob.h,
qt/src/qgpgmedeletejob.cpp,
qt/src/qgpgmedownloadjob.cpp,
qt/src/qgpgmedownloadjob.h,
qt/src/qgpgmeencryptjob.cpp,
qt/src/qgpgmeencryptjob.h,
qt/src/qgpgmeexportjob.cpp,
qt/src/qgpgmeexportjob.h,
qt/src/qgpgmeimportfromkeyserverjob.cpp,
qt/src/qgpgmeimportfromkeyserverjob.h,
qt/src/qgpgmeimportjob.cpp,
qt/src/qgpgmeimportjob.h,
qt/src/qgpgmekeygenerationjob.cpp,
qt/src/qgpgmekeygenerationjob.h,
qt/src/qgpgmekeylistjob.cpp,
qt/src/qgpgmekeylistjob.h,
qt/src/qgpgmelistallkeysjob.cpp,
qt/src/qgpgmelistallkeysjob.h,
qt/src/qgpgmenewcryptoconfig.cpp,
qt/src/qgpgmenewcryptoconfig.h,
qt/src/qgpgmesignencryptjob.cpp,
qt/src/qgpgmesignencryptjob.h,
qt/src/qgpgmesignjob.cpp,
qt/src/qgpgmesignjob.h,
qt/src/qgpgmesignkeyjob.cpp,
qt/src/qgpgmeverifydetachedjob.cpp,
qt/src/qgpgmeverifydetachedjob.h,
qt/src/qgpgmeverifyopaquejob.cpp,
qt/src/qgpgmeverifyopaquejob.h,
qt/src/signencryptjob.h,
qt/src/signjob.h,
qt/src/threadedjobmixin.h,
qt/src/verifydetachedjob.h,
qt/src/verifyopaquejob.h: Reduce boost usage.
--
This was mostly done with search and replace to change the
templates / classes from memory and tuple to their c++11
equivalents.
2016-04-03 12:52:16 +00:00
|
|
|
std::shared_ptr<VerificationResult::Private> d;
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
unsigned int sidx, nidx;
|
|
|
|
gpgme_sig_notation_t nota;
|
|
|
|
};
|
|
|
|
|
Cpp / Qt: Reduce boost usage (memory and tuple)
* cpp/src/assuanresult.h,
cpp/src/configuration.cpp,
cpp/src/configuration.h,
cpp/src/data.h,
cpp/src/decryptionresult.h,
cpp/src/defaultassuantransaction.cpp,
cpp/src/encryptionresult.cpp,
cpp/src/encryptionresult.h,
cpp/src/engineinfo.h,
cpp/src/gpgagentgetinfoassuantransaction.cpp,
cpp/src/gpgsignkeyeditinteractor.cpp,
cpp/src/importresult.cpp,
cpp/src/importresult.h,
cpp/src/key.h,
cpp/src/keygenerationresult.h,
cpp/src/keylistresult.h,
cpp/src/notation.h,
cpp/src/signingresult.cpp,
cpp/src/signingresult.h,
cpp/src/verificationresult.cpp,
cpp/src/verificationresult.h,
cpp/src/vfsmountresult.h,
qt/src/dataprovider.cpp,
qt/src/dataprovider.h,
qt/src/decryptjob.h,
qt/src/decryptverifyjob.h,
qt/src/downloadjob.h,
qt/src/encryptjob.h,
qt/src/qgpgmeadduseridjob.cpp,
qt/src/qgpgmechangeexpiryjob.cpp,
qt/src/qgpgmechangeownertrustjob.cpp,
qt/src/qgpgmechangepasswdjob.cpp,
qt/src/qgpgmedecryptjob.cpp,
qt/src/qgpgmedecryptjob.h,
qt/src/qgpgmedecryptverifyjob.cpp,
qt/src/qgpgmedecryptverifyjob.h,
qt/src/qgpgmedeletejob.cpp,
qt/src/qgpgmedownloadjob.cpp,
qt/src/qgpgmedownloadjob.h,
qt/src/qgpgmeencryptjob.cpp,
qt/src/qgpgmeencryptjob.h,
qt/src/qgpgmeexportjob.cpp,
qt/src/qgpgmeexportjob.h,
qt/src/qgpgmeimportfromkeyserverjob.cpp,
qt/src/qgpgmeimportfromkeyserverjob.h,
qt/src/qgpgmeimportjob.cpp,
qt/src/qgpgmeimportjob.h,
qt/src/qgpgmekeygenerationjob.cpp,
qt/src/qgpgmekeygenerationjob.h,
qt/src/qgpgmekeylistjob.cpp,
qt/src/qgpgmekeylistjob.h,
qt/src/qgpgmelistallkeysjob.cpp,
qt/src/qgpgmelistallkeysjob.h,
qt/src/qgpgmenewcryptoconfig.cpp,
qt/src/qgpgmenewcryptoconfig.h,
qt/src/qgpgmesignencryptjob.cpp,
qt/src/qgpgmesignencryptjob.h,
qt/src/qgpgmesignjob.cpp,
qt/src/qgpgmesignjob.h,
qt/src/qgpgmesignkeyjob.cpp,
qt/src/qgpgmeverifydetachedjob.cpp,
qt/src/qgpgmeverifydetachedjob.h,
qt/src/qgpgmeverifyopaquejob.cpp,
qt/src/qgpgmeverifyopaquejob.h,
qt/src/signencryptjob.h,
qt/src/signjob.h,
qt/src/threadedjobmixin.h,
qt/src/verifydetachedjob.h,
qt/src/verifyopaquejob.h: Reduce boost usage.
--
This was mostly done with search and replace to change the
templates / classes from memory and tuple to their c++11
equivalents.
2016-04-03 12:52:16 +00:00
|
|
|
GpgME::Notation::Notation(const std::shared_ptr<VerificationResult::Private> &parent, unsigned int sindex, unsigned int nindex)
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
: d(new Private(parent, sindex, nindex))
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::Notation::Notation(gpgme_sig_notation_t nota)
|
|
|
|
: d(new Private(nota))
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::Notation::Notation() : d() {}
|
|
|
|
|
|
|
|
bool GpgME::Notation::isNull() const
|
|
|
|
{
|
|
|
|
if (!d) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (d->d) {
|
|
|
|
return d->sidx >= d->d->nota.size() || d->nidx >= d->d->nota[d->sidx].size() ;
|
|
|
|
}
|
|
|
|
return !d->nota;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *GpgME::Notation::name() const
|
|
|
|
{
|
|
|
|
return
|
|
|
|
isNull() ? 0 :
|
|
|
|
d->d ? d->d->nota[d->sidx][d->nidx].name :
|
|
|
|
d->nota ? d->nota->name : 0 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *GpgME::Notation::value() const
|
|
|
|
{
|
|
|
|
return
|
|
|
|
isNull() ? 0 :
|
|
|
|
d->d ? d->d->nota[d->sidx][d->nidx].value :
|
|
|
|
d->nota ? d->nota->value : 0 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpgME::Notation::Flags GpgME::Notation::flags() const
|
|
|
|
{
|
|
|
|
return
|
|
|
|
convert_from_gpgme_sig_notation_flags_t(
|
|
|
|
isNull() ? 0 :
|
|
|
|
d->d ? d->d->nota[d->sidx][d->nidx].flags :
|
|
|
|
d->nota ? d->nota->flags : 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GpgME::Notation::isHumanReadable() const
|
|
|
|
{
|
|
|
|
return flags() & HumanReadable;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GpgME::Notation::isCritical() const
|
|
|
|
{
|
|
|
|
return flags() & Critical;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::ostream &GpgME::operator<<(std::ostream &os, const VerificationResult &result)
|
|
|
|
{
|
|
|
|
os << "GpgME::VerificationResult(";
|
|
|
|
if (!result.isNull()) {
|
|
|
|
os << "\n error: " << result.error()
|
|
|
|
<< "\n fileName: " << protect(result.fileName())
|
|
|
|
<< "\n signatures:\n";
|
|
|
|
const std::vector<Signature> sigs = result.signatures();
|
|
|
|
std::copy(sigs.begin(), sigs.end(),
|
|
|
|
std::ostream_iterator<Signature>(os, "\n"));
|
|
|
|
}
|
|
|
|
return os << ')';
|
|
|
|
}
|
|
|
|
|
|
|
|
std::ostream &GpgME::operator<<(std::ostream &os, Signature::PKAStatus pkaStatus)
|
|
|
|
{
|
|
|
|
#define OUTPUT( x ) if ( !(pkaStatus & (GpgME::Signature:: x)) ) {} else do { os << #x " "; } while(0)
|
|
|
|
os << "GpgME::Signature::PKAStatus(";
|
|
|
|
OUTPUT(UnknownPKAStatus);
|
|
|
|
OUTPUT(PKAVerificationFailed);
|
|
|
|
OUTPUT(PKAVerificationSucceeded);
|
|
|
|
#undef OUTPUT
|
|
|
|
return os << ')';
|
|
|
|
}
|
|
|
|
|
|
|
|
std::ostream &GpgME::operator<<(std::ostream &os, Signature::Summary summary)
|
|
|
|
{
|
|
|
|
#define OUTPUT( x ) if ( !(summary & (GpgME::Signature:: x)) ) {} else do { os << #x " "; } while(0)
|
|
|
|
os << "GpgME::Signature::Summary(";
|
|
|
|
OUTPUT(Valid);
|
|
|
|
OUTPUT(Green);
|
|
|
|
OUTPUT(Red);
|
|
|
|
OUTPUT(KeyRevoked);
|
|
|
|
OUTPUT(KeyExpired);
|
|
|
|
OUTPUT(SigExpired);
|
|
|
|
OUTPUT(KeyMissing);
|
|
|
|
OUTPUT(CrlMissing);
|
|
|
|
OUTPUT(CrlTooOld);
|
|
|
|
OUTPUT(BadPolicy);
|
|
|
|
OUTPUT(SysError);
|
2016-07-04 09:31:01 +00:00
|
|
|
OUTPUT(TofuConflict);
|
Initial checkin of gpgmepp sources
Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02
* lang/cpp/src/assuanresult.cpp,
lang/cpp/src/assuanresult.h,
lang/cpp/src/callbacks.cpp,
lang/cpp/src/callbacks.h,
lang/cpp/src/configuration.cpp,
lang/cpp/src/configuration.h,
lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_p.h,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/data.h,
lang/cpp/src/data_p.h,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/decryptionresult.h,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/editinteractor.h,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/encryptionresult.h,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/engineinfo.h,
lang/cpp/src/error.h,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/eventloopinteractor.h,
lang/cpp/src/exception.cpp,
lang/cpp/src/exception.h,
lang/cpp/src/global.h,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpgmefw.h,
lang/cpp/src/gpgmepp_export.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/importresult.cpp,
lang/cpp/src/importresult.h,
lang/cpp/src/key.cpp,
lang/cpp/src/key.h,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keygenerationresult.h,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/keylistresult.h,
lang/cpp/src/notation.h,
lang/cpp/src/result.h,
lang/cpp/src/result_p.h,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/signingresult.h,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/trustitem.h,
lang/cpp/src/util.h,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/verificationresult.h,
lang/cpp/src/vfsmountresult.cpp,
lang/cpp/src/vfsmountresult.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/passphraseprovider.h,
lang/cpp/src/interfaces/progressprovider.h: New.
2016-02-22 17:28:08 +00:00
|
|
|
#undef OUTPUT
|
|
|
|
return os << ')';
|
|
|
|
}
|
|
|
|
|
|
|
|
std::ostream &GpgME::operator<<(std::ostream &os, const Signature &sig)
|
|
|
|
{
|
|
|
|
os << "GpgME::Signature(";
|
|
|
|
if (!sig.isNull()) {
|
|
|
|
os << "\n Summary: " << sig.summary()
|
|
|
|
<< "\n Fingerprint: " << protect(sig.fingerprint())
|
|
|
|
<< "\n Status: " << sig.status()
|
|
|
|
<< "\n creationTime: " << sig.creationTime()
|
|
|
|
<< "\n expirationTime: " << sig.expirationTime()
|
|
|
|
<< "\n isWrongKeyUsage: " << sig.isWrongKeyUsage()
|
|
|
|
<< "\n isVerifiedUsingChainModel: " << sig.isVerifiedUsingChainModel()
|
|
|
|
<< "\n pkaStatus: " << sig.pkaStatus()
|
|
|
|
<< "\n pkaAddress: " << protect(sig.pkaAddress())
|
|
|
|
<< "\n validity: " << sig.validityAsString()
|
|
|
|
<< "\n nonValidityReason: " << sig.nonValidityReason()
|
|
|
|
<< "\n publicKeyAlgorithm: " << protect(sig.publicKeyAlgorithmAsString())
|
|
|
|
<< "\n hashAlgorithm: " << protect(sig.hashAlgorithmAsString())
|
|
|
|
<< "\n policyURL: " << protect(sig.policyURL())
|
|
|
|
<< "\n notations:\n";
|
|
|
|
const std::vector<Notation> nota = sig.notations();
|
|
|
|
std::copy(nota.begin(), nota.end(),
|
|
|
|
std::ostream_iterator<Notation>(os, "\n"));
|
|
|
|
}
|
|
|
|
return os << ')';
|
|
|
|
}
|
|
|
|
|
|
|
|
std::ostream &GpgME::operator<<(std::ostream &os, Notation::Flags flags)
|
|
|
|
{
|
|
|
|
os << "GpgME::Notation::Flags(";
|
|
|
|
#define OUTPUT( x ) if ( !(flags & (GpgME::Notation:: x)) ) {} else do { os << #x " "; } while(0)
|
|
|
|
OUTPUT(HumanReadable);
|
|
|
|
OUTPUT(Critical);
|
|
|
|
#undef OUTPUT
|
|
|
|
return os << ')';
|
|
|
|
}
|
|
|
|
|
|
|
|
std::ostream &GpgME::operator<<(std::ostream &os, const Notation ¬a)
|
|
|
|
{
|
|
|
|
os << "GpgME::Signature::Notation(";
|
|
|
|
if (!nota.isNull()) {
|
|
|
|
os << "\n name: " << protect(nota.name())
|
|
|
|
<< "\n value: " << protect(nota.value())
|
|
|
|
<< "\n flags: " << nota.flags()
|
|
|
|
<< '\n';
|
|
|
|
}
|
|
|
|
return os << ")";
|
|
|
|
}
|