|
Packit |
d7e8d0 |
/*
|
|
Packit |
d7e8d0 |
decryptionresult.h - wraps a gpgme keygen result
|
|
Packit |
d7e8d0 |
Copyright (C) 2004 Klarälvdalens Datakonsult AB
|
|
Packit |
d7e8d0 |
2016 Bundesamt für Sicherheit in der Informationstechnik
|
|
Packit |
d7e8d0 |
Software engineering by Intevation GmbH
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
This file is part of GPGME++.
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
GPGME++ is free software; you can redistribute it and/or
|
|
Packit |
d7e8d0 |
modify it under the terms of the GNU Library General Public
|
|
Packit |
d7e8d0 |
License as published by the Free Software Foundation; either
|
|
Packit |
d7e8d0 |
version 2 of the License, or (at your option) any later version.
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
GPGME++ is distributed in the hope that it will be useful,
|
|
Packit |
d7e8d0 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
d7e8d0 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
d7e8d0 |
GNU Library General Public License for more details.
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
You should have received a copy of the GNU Library General Public License
|
|
Packit |
d7e8d0 |
along with GPGME++; see the file COPYING.LIB. If not, write to the
|
|
Packit |
d7e8d0 |
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
Packit |
d7e8d0 |
Boston, MA 02110-1301, USA.
|
|
Packit |
d7e8d0 |
*/
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
#ifndef __GPGMEPP_DECRYPTIONRESULT_H__
|
|
Packit |
d7e8d0 |
#define __GPGMEPP_DECRYPTIONRESULT_H__
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
#include "gpgmefw.h"
|
|
Packit |
d7e8d0 |
#include "result.h"
|
|
Packit |
d7e8d0 |
#include "gpgmepp_export.h"
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
#include <vector>
|
|
Packit |
d7e8d0 |
#include <algorithm>
|
|
Packit |
d7e8d0 |
#include <iosfwd>
|
|
Packit |
d7e8d0 |
#include <memory>
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
namespace GpgME
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
class Error;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
class GPGMEPP_EXPORT DecryptionResult : public Result
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
public:
|
|
Packit |
d7e8d0 |
DecryptionResult();
|
|
Packit |
d7e8d0 |
DecryptionResult(gpgme_ctx_t ctx, int error);
|
|
Packit |
d7e8d0 |
DecryptionResult(gpgme_ctx_t ctx, const Error &err;;
|
|
Packit |
d7e8d0 |
explicit DecryptionResult(const Error &err;;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
const DecryptionResult &operator=(DecryptionResult other)
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
swap(other);
|
|
Packit |
d7e8d0 |
return *this;
|
|
Packit |
d7e8d0 |
}
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
void swap(DecryptionResult &other)
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
Result::swap(other);
|
|
Packit |
d7e8d0 |
using std::swap;
|
|
Packit |
d7e8d0 |
swap(this->d, other.d);
|
|
Packit |
d7e8d0 |
}
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
bool isNull() const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
GPGMEPP_DEPRECATED const char *unsupportedAlgortihm() const
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
return unsupportedAlgorithm();
|
|
Packit |
d7e8d0 |
}
|
|
Packit |
d7e8d0 |
const char *unsupportedAlgorithm() const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
GPGMEPP_DEPRECATED bool wrongKeyUsage() const
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
return isWrongKeyUsage();
|
|
Packit |
d7e8d0 |
}
|
|
Packit |
d7e8d0 |
bool isWrongKeyUsage() const;
|
|
Packit |
d7e8d0 |
bool isDeVs() const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
const char *fileName() const;
|
|
Packit |
d7e8d0 |
|
|
Packit Service |
30b792 |
const char *sessionKey() const;
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
const char *symkeyAlgo() const;
|
|
Packit Service |
30b792 |
|
|
Packit |
d7e8d0 |
class Recipient;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
unsigned int numRecipients() const;
|
|
Packit |
d7e8d0 |
Recipient recipient(unsigned int idx) const;
|
|
Packit |
d7e8d0 |
std::vector<Recipient> recipients() const;
|
|
Packit |
d7e8d0 |
|
|
Packit Service |
30b792 |
bool isLegacyCipherNoMDC() const;
|
|
Packit Service |
30b792 |
|
|
Packit |
d7e8d0 |
private:
|
|
Packit |
d7e8d0 |
class Private;
|
|
Packit |
d7e8d0 |
void init(gpgme_ctx_t ctx);
|
|
Packit |
d7e8d0 |
std::shared_ptr<Private> d;
|
|
Packit |
d7e8d0 |
};
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const DecryptionResult &result);
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
class GPGMEPP_EXPORT DecryptionResult::Recipient
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
public:
|
|
Packit |
d7e8d0 |
Recipient();
|
|
Packit |
d7e8d0 |
explicit Recipient(gpgme_recipient_t reci);
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
const Recipient &operator=(Recipient other)
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
swap(other);
|
|
Packit |
d7e8d0 |
return *this;
|
|
Packit |
d7e8d0 |
}
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
void swap(Recipient &other)
|
|
Packit |
d7e8d0 |
{
|
|
Packit |
d7e8d0 |
using std::swap;
|
|
Packit |
d7e8d0 |
swap(this->d, other.d);
|
|
Packit |
d7e8d0 |
}
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
bool isNull() const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
const char *keyID() const;
|
|
Packit |
d7e8d0 |
const char *shortKeyID() const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
unsigned int publicKeyAlgorithm() const;
|
|
Packit |
d7e8d0 |
const char *publicKeyAlgorithmAsString() const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
Error status() const;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
private:
|
|
Packit |
d7e8d0 |
class Private;
|
|
Packit |
d7e8d0 |
std::shared_ptr<Private> d;
|
|
Packit |
d7e8d0 |
};
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const DecryptionResult::Recipient &reci;;
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
}
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION(DecryptionResult)
|
|
Packit |
d7e8d0 |
|
|
Packit |
d7e8d0 |
#endif // __GPGMEPP_DECRYPTIONRESULT_H__
|