Blame lang/cpp/src/context.h

Packit Service 672cf4
/*
Packit Service 672cf4
  context.h - wraps a gpgme key context
Packit Service 672cf4
  Copyright (C) 2003, 2007 Klarälvdalens Datakonsult AB
Packit Service 672cf4
Packit Service 672cf4
  This file is part of GPGME++.
Packit Service 672cf4
Packit Service 672cf4
  GPGME++ is free software; you can redistribute it and/or
Packit Service 672cf4
  modify it under the terms of the GNU Library General Public
Packit Service 672cf4
  License as published by the Free Software Foundation; either
Packit Service 672cf4
  version 2 of the License, or (at your option) any later version.
Packit Service 672cf4
Packit Service 672cf4
  GPGME++ is distributed in the hope that it will be useful,
Packit Service 672cf4
  but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 672cf4
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 672cf4
  GNU Library General Public License for more details.
Packit Service 672cf4
Packit Service 672cf4
  You should have received a copy of the GNU Library General Public License
Packit Service 672cf4
  along with GPGME++; see the file COPYING.LIB.  If not, write to the
Packit Service 672cf4
  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Packit Service 672cf4
  Boston, MA 02110-1301, USA.
Packit Service 672cf4
*/
Packit Service 672cf4
Packit Service 672cf4
// -*- c++ -*-
Packit Service 672cf4
#ifndef __GPGMEPP_CONTEXT_H__
Packit Service 672cf4
#define __GPGMEPP_CONTEXT_H__
Packit Service 672cf4
Packit Service 672cf4
#include "global.h"
Packit Service 672cf4
Packit Service 672cf4
#include "error.h"
Packit Service 672cf4
#include "verificationresult.h" // for Signature::Notation
Packit Service 672cf4
Packit Service 672cf4
#include <memory>
Packit Service 672cf4
#include <vector>
Packit Service 672cf4
#include <utility>
Packit Service 672cf4
#include <iosfwd>
Packit Service 672cf4
Packit Service 672cf4
namespace GpgME
Packit Service 672cf4
{
Packit Service 672cf4
Packit Service 672cf4
class Key;
Packit Service 672cf4
class Data;
Packit Service 672cf4
class TrustItem;
Packit Service 672cf4
class ProgressProvider;
Packit Service 672cf4
class PassphraseProvider;
Packit Service 672cf4
class EventLoopInteractor;
Packit Service 672cf4
class EditInteractor;
Packit Service 672cf4
class AssuanTransaction;
Packit Service 672cf4
Packit Service 672cf4
class KeyListResult;
Packit Service 672cf4
class KeyGenerationResult;
Packit Service 672cf4
class ImportResult;
Packit Service 672cf4
class DecryptionResult;
Packit Service 672cf4
class VerificationResult;
Packit Service 672cf4
class SigningResult;
Packit Service 672cf4
class EncryptionResult;
Packit Service 672cf4
class VfsMountResult;
Packit Service 672cf4
Packit Service 672cf4
class EngineInfo;
Packit Service 672cf4
Packit Service 672cf4
class GPGMEPP_EXPORT Context
Packit Service 672cf4
{
Packit Service 672cf4
    explicit Context(gpgme_ctx_t);
Packit Service 672cf4
public:
Packit Service 672cf4
    //using GpgME::Protocol;
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Creation and destruction:
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    static Context *createForProtocol(Protocol proto);
Packit Service 6c01f9
    static std::unique_ptr<Context> createForEngine(Engine engine, Error *err = 0);
Packit Service 672cf4
    virtual ~Context();
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Context Attributes
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    Protocol protocol() const;
Packit Service 672cf4
Packit Service 672cf4
    void setArmor(bool useArmor);
Packit Service 672cf4
    bool armor() const;
Packit Service 672cf4
Packit Service 672cf4
    void setTextMode(bool useTextMode);
Packit Service 672cf4
    bool textMode() const;
Packit Service 672cf4
Packit Service 672cf4
    void setOffline(bool useOfflineMode);
Packit Service 672cf4
    bool offline() const;
Packit Service 672cf4
Packit Service 672cf4
    enum CertificateInclusion {
Packit Service 672cf4
        DefaultCertificates = -256,
Packit Service 672cf4
        AllCertificatesExceptRoot = -2,
Packit Service 672cf4
        AllCertificates = -1,
Packit Service 672cf4
        NoCertificates = 0,
Packit Service 672cf4
        OnlySenderCertificate = 1
Packit Service 672cf4
    };
Packit Service 672cf4
    void setIncludeCertificates(int which);
Packit Service 672cf4
    int includeCertificates() const;
Packit Service 672cf4
Packit Service 672cf4
    //using GpgME::KeyListMode;
Packit Service 672cf4
    void setKeyListMode(unsigned int keyListMode);
Packit Service 672cf4
    void addKeyListMode(unsigned int keyListMode);
Packit Service 672cf4
    unsigned int keyListMode() const;
Packit Service 672cf4
Packit Service 672cf4
    /** Set the passphrase provider
Packit Service 672cf4
     *
Packit Service 672cf4
     * To avoid problems where a class using a context registers
Packit Service 672cf4
     * itself as the provider the Context does not take ownership
Packit Service 672cf4
     * of the provider and the caller must ensure that the provider
Packit Service 672cf4
     * is deleted if it is no longer needed.
Packit Service 672cf4
     */
Packit Service 672cf4
    void setPassphraseProvider(PassphraseProvider *provider);
Packit Service 672cf4
    PassphraseProvider *passphraseProvider() const;
Packit Service 672cf4
Packit Service 672cf4
    /** Set the progress provider
Packit Service 672cf4
     *
Packit Service 672cf4
     * To avoid problems where a class using a context registers
Packit Service 672cf4
     * itself as the provider the Context does not take ownership
Packit Service 672cf4
     * of the provider and the caller must ensure that the provider
Packit Service 672cf4
     * is deleted if it is no longer needed.
Packit Service 672cf4
     */
Packit Service 672cf4
    void setProgressProvider(ProgressProvider *provider);
Packit Service 672cf4
    ProgressProvider *progressProvider() const;
Packit Service 672cf4
Packit Service 672cf4
    void setManagedByEventLoopInteractor(bool managed);
Packit Service 672cf4
    bool managedByEventLoopInteractor() const;
Packit Service 672cf4
Packit Service 672cf4
    GpgME::Error setLocale(int category, const char *value);
Packit Service 672cf4
Packit Service 672cf4
    EngineInfo engineInfo() const;
Packit Service 672cf4
    GpgME::Error setEngineFileName(const char *filename);
Packit Service 672cf4
    GpgME::Error setEngineHomeDirectory(const char *filename);
Packit Service 672cf4
Packit Service 672cf4
    enum PinentryMode{
Packit Service 672cf4
        PinentryDefault = 0,
Packit Service 672cf4
        PinentryAsk = 1,
Packit Service 672cf4
        PinentryCancel = 2,
Packit Service 672cf4
        PinentryError = 3,
Packit Service 672cf4
        PinentryLoopback = 4
Packit Service 672cf4
    };
Packit Service 672cf4
    GpgME::Error setPinentryMode(PinentryMode which);
Packit Service 672cf4
    PinentryMode pinentryMode() const;
Packit Service 672cf4
Packit Service 672cf4
private:
Packit Service 672cf4
    friend class ::GpgME::EventLoopInteractor;
Packit Service 672cf4
    void installIOCallbacks(gpgme_io_cbs *iocbs);
Packit Service 672cf4
    void uninstallIOCallbacks();
Packit Service 672cf4
Packit Service 672cf4
public:
Packit Service 672cf4
    //
Packit Service 672cf4
    //
Packit Service 672cf4
    // Key Management
Packit Service 672cf4
    //
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Key Listing
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 6c01f9
    GpgME::Error startKeyListing(const char *pattern = 0, bool secretOnly = false);
Packit Service 672cf4
    GpgME::Error startKeyListing(const char *patterns[], bool secretOnly = false);
Packit Service 672cf4
Packit Service 672cf4
    Key nextKey(GpgME::Error &e);
Packit Service 672cf4
Packit Service 672cf4
    KeyListResult endKeyListing();
Packit Service 672cf4
    KeyListResult keyListResult() const;
Packit Service 672cf4
Packit Service 672cf4
    Key key(const char *fingerprint, GpgME::Error &e, bool secret = false);
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Key Generation
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    KeyGenerationResult generateKey(const char *parameters, Data &pubKey);
Packit Service 672cf4
    GpgME::Error startKeyGeneration(const char *parameters, Data &pubkey);
Packit Service 672cf4
    KeyGenerationResult keyGenerationResult() const;
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Key Export
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    GpgME::Error exportPublicKeys(const char *pattern, Data &keyData);
Packit Service 672cf4
    GpgME::Error exportPublicKeys(const char *pattern[], Data &keyData);
Packit Service 672cf4
    GpgME::Error startPublicKeyExport(const char *pattern, Data &keyData);
Packit Service 672cf4
    GpgME::Error startPublicKeyExport(const char *pattern[], Data &keyData);
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Key Import
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    ImportResult importKeys(const Data &data);
Packit Service 672cf4
    ImportResult importKeys(const std::vector<Key> &keys);
Packit Service 672cf4
    GpgME::Error startKeyImport(const Data &data);
Packit Service 672cf4
    GpgME::Error startKeyImport(const std::vector<Key> &keys);
Packit Service 672cf4
    ImportResult importResult() const;
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Key Deletion
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    GpgME::Error deleteKey(const Key &key, bool allowSecretKeyDeletion = false);
Packit Service 672cf4
    GpgME::Error startKeyDeletion(const Key &key, bool allowSecretKeyDeletion = false);
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Passphrase changing
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    GpgME::Error passwd(const Key &key);
Packit Service 672cf4
    GpgME::Error startPasswd(const Key &key);
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Key Editing
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    GpgME::Error edit(const Key &key, std::unique_ptr<EditInteractor> function, Data &out;;
Packit Service 672cf4
    GpgME::Error startEditing(const Key &key, std::unique_ptr<EditInteractor> function, Data &out;;
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Modern Interface actions. Require 2.1.x
Packit Service 672cf4
    //
Packit Service 672cf4
    Error startCreateKey (const char *userid,
Packit Service 672cf4
                          const char *algo,
Packit Service 672cf4
                          unsigned long reserved,
Packit Service 672cf4
                          unsigned long expires,
Packit Service 672cf4
                          const Key &certkey,
Packit Service 672cf4
                          unsigned int flags);
Packit Service 672cf4
    Error createKey (const char *userid,
Packit Service 672cf4
                     const char *algo,
Packit Service 672cf4
                     unsigned long reserved,
Packit Service 672cf4
                     unsigned long expires,
Packit Service 672cf4
                     const Key &certkey,
Packit Service 672cf4
                     unsigned int flags);
Packit Service 672cf4
Packit Service 672cf4
    Error addUid(const Key &key, const char *userid);
Packit Service 672cf4
    Error startAddUid(const Key &key, const char *userid);
Packit Service 672cf4
Packit Service 672cf4
    Error revUid(const Key &key, const char *userid);
Packit Service 672cf4
    Error startRevUid(const Key &key, const char *userid);
Packit Service 672cf4
Packit Service 672cf4
    Error createSubkey(const Key &key, const char *algo,
Packit Service 672cf4
                       unsigned long reserved = 0,
Packit Service 672cf4
                       unsigned long expires = 0,
Packit Service 672cf4
                       unsigned int flags = 0);
Packit Service 672cf4
    Error startCreateSubkey(const Key &key, const char *algo,
Packit Service 672cf4
                            unsigned long reserved = 0,
Packit Service 672cf4
                            unsigned long expires = 0,
Packit Service 672cf4
                            unsigned int flags = 0);
Packit Service 672cf4
Packit Service 672cf4
    // using TofuInfo::Policy
Packit Service 672cf4
    Error setTofuPolicy(const Key &k, unsigned int policy);
Packit Service 672cf4
    Error setTofuPolicyStart(const Key &k, unsigned int policy);
Packit Service 672cf4
Packit Service 672cf4
    EditInteractor *lastEditInteractor() const;
Packit Service 672cf4
    std::unique_ptr<EditInteractor> takeLastEditInteractor();
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // SmartCard Editing
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    GpgME::Error cardEdit(const Key &key, std::unique_ptr<EditInteractor> function, Data &out;;
Packit Service 672cf4
    GpgME::Error startCardEditing(const Key &key, std::unique_ptr<EditInteractor> function, Data &out;;
Packit Service 672cf4
Packit Service 672cf4
    EditInteractor *lastCardEditInteractor() const;
Packit Service 672cf4
    std::unique_ptr<EditInteractor> takeLastCardEditInteractor();
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Trust Item Management
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    GpgME::Error startTrustItemListing(const char *pattern, int maxLevel);
Packit Service 672cf4
    TrustItem nextTrustItem(GpgME::Error &e);
Packit Service 672cf4
    GpgME::Error endTrustItemListing();
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Assuan Transactions
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    GpgME::Error assuanTransact(const char *command, std::unique_ptr<AssuanTransaction> transaction);
Packit Service 672cf4
    GpgME::Error assuanTransact(const char *command);
Packit Service 672cf4
    GpgME::Error startAssuanTransaction(const char *command, std::unique_ptr<AssuanTransaction> transaction);
Packit Service 672cf4
    GpgME::Error startAssuanTransaction(const char *command);
Packit Service 672cf4
Packit Service 672cf4
    AssuanTransaction *lastAssuanTransaction() const;
Packit Service 672cf4
    std::unique_ptr<AssuanTransaction> takeLastAssuanTransaction();
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    //
Packit Service 672cf4
    // Crypto Operations
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    enum DecryptionFlags {
Packit Service 672cf4
        // Keep in line with core's flags
Packit Service 672cf4
        DecryptNone = 0,
Packit Service 672cf4
        DecryptVerify = 1,
Packit Service 672cf4
        DecryptUnwrap = 128,
Packit Service 672cf4
        DecryptMaxValue = 0x80000000
Packit Service 672cf4
    };
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Decryption
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    // Alternative way to set decryption flags as they were added only in
Packit Service 672cf4
    // 1.9.0 and so other API can still be used but with 1.9.0 additionally
Packit Service 672cf4
    // flags can be set.
Packit Service 672cf4
    void setDecryptionFlags (const DecryptionFlags flags);
Packit Service 672cf4
Packit Service 672cf4
    DecryptionResult decrypt(const Data &cipherText, Data &plainText);
Packit Service 672cf4
    GpgME::Error startDecryption(const Data &cipherText, Data &plainText);
Packit Service 672cf4
    DecryptionResult decrypt(const Data &cipherText, Data &plainText, const DecryptionFlags flags);
Packit Service 672cf4
    GpgME::Error startDecryption(const Data &cipherText, Data &plainText, const DecryptionFlags flags);
Packit Service 672cf4
    DecryptionResult decryptionResult() const;
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Signature Verification
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    VerificationResult verifyDetachedSignature(const Data &signature, const Data &signedText);
Packit Service 672cf4
    VerificationResult verifyOpaqueSignature(const Data &signedData, Data &plainText);
Packit Service 672cf4
    GpgME::Error startDetachedSignatureVerification(const Data &signature, const Data &signedText);
Packit Service 672cf4
    GpgME::Error startOpaqueSignatureVerification(const Data &signedData, Data &plainText);
Packit Service 672cf4
    VerificationResult verificationResult() const;
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Combined Decryption and Signature Verification
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    std::pair<DecryptionResult, VerificationResult> decryptAndVerify(const Data &cipherText, Data &plainText);
Packit Service 672cf4
    std::pair<DecryptionResult, VerificationResult> decryptAndVerify(const Data &cipherText, Data &plainText, const DecryptionFlags flags);
Packit Service 672cf4
    GpgME::Error startCombinedDecryptionAndVerification(const Data &cipherText, Data &plainText);
Packit Service 672cf4
    GpgME::Error startCombinedDecryptionAndVerification(const Data &cipherText, Data &plainText, const DecryptionFlags flags);
Packit Service 672cf4
    // use verificationResult() and decryptionResult() to retrieve the result objects...
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Signing
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    void clearSigningKeys();
Packit Service 672cf4
    GpgME::Error addSigningKey(const Key &signer);
Packit Service 672cf4
    Key signingKey(unsigned int index) const;
Packit Service 672cf4
    std::vector<Key> signingKeys() const;
Packit Service 672cf4
Packit Service 672cf4
    void clearSignatureNotations();
Packit Service 672cf4
    GpgME::Error addSignatureNotation(const char *name, const char *value, unsigned int flags = 0);
Packit Service 672cf4
    GpgME::Error addSignaturePolicyURL(const char *url, bool critical = false);
Packit Service 672cf4
    const char *signaturePolicyURL() const;
Packit Service 672cf4
    Notation signatureNotation(unsigned int index) const;
Packit Service 672cf4
    std::vector<Notation> signatureNotations() const;
Packit Service 672cf4
Packit Service 672cf4
    //using GpgME::SignatureMode;
Packit Service 672cf4
    SigningResult sign(const Data &plainText, Data &signature, SignatureMode mode);
Packit Service 672cf4
    GpgME::Error startSigning(const Data &plainText, Data &signature, SignatureMode mode);
Packit Service 672cf4
    SigningResult signingResult() const;
Packit Service 672cf4
Packit Service 672cf4
    // wrapper for gpgme_set_sender
Packit Service 672cf4
    const char *getSender();
Packit Service 672cf4
    GpgME::Error setSender(const char *sender);
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Encryption
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    enum EncryptionFlags {
Packit Service 672cf4
        None = 0,
Packit Service 672cf4
        AlwaysTrust = 1,
Packit Service 672cf4
        NoEncryptTo = 2,
Packit Service 672cf4
        Prepare = 4,
Packit Service 672cf4
        ExpectSign = 8,
Packit Service 672cf4
        NoCompress = 16,
Packit Service 672cf4
        Symmetric = 32,
Packit Service 672cf4
        ThrowKeyIds = 64,
Packit Service 672cf4
        EncryptWrap = 128
Packit Service 672cf4
    };
Packit Service 672cf4
    EncryptionResult encrypt(const std::vector<Key> &recipients, const Data &plainText, Data &cipherText, EncryptionFlags flags);
Packit Service 672cf4
    GpgME::Error encryptSymmetrically(const Data &plainText, Data &cipherText);
Packit Service 672cf4
    GpgME::Error startEncryption(const std::vector<Key> &recipients, const Data &plainText, Data &cipherText, EncryptionFlags flags);
Packit Service 672cf4
    EncryptionResult encryptionResult() const;
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    // Combined Signing and Encryption
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    std::pair<SigningResult, EncryptionResult> signAndEncrypt(const std::vector<Key> &recipients, const Data &plainText, Data &cipherText, EncryptionFlags flags);
Packit Service 672cf4
    GpgME::Error startCombinedSigningAndEncryption(const std::vector<Key> &recipients, const Data &plainText, Data &cipherText, EncryptionFlags flags);
Packit Service 672cf4
    // use encryptionResult() and signingResult() to retrieve the result objects...
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    //
Packit Service 672cf4
    // Audit Log
Packit Service 672cf4
    //
Packit Service 672cf4
    //
Packit Service 672cf4
    enum AuditLogFlags {
Packit Service 672cf4
        HtmlAuditLog = 1,
Packit Service 672cf4
        AuditLogWithHelp = 128
Packit Service 672cf4
    };
Packit Service 672cf4
    GpgME::Error startGetAuditLog(Data &output, unsigned int flags = 0);
Packit Service 672cf4
    GpgME::Error getAuditLog(Data &output, unsigned int flags = 0);
Packit Service 672cf4
Packit Service 672cf4
    //
Packit Service 672cf4
    //
Packit Service 672cf4
    // G13 crypto container operations
Packit Service 672cf4
    //
Packit Service 672cf4
    //
Packit Service 672cf4
    GpgME::Error createVFS(const char *containerFile, const std::vector<Key> &recipients);
Packit Service 672cf4
    VfsMountResult mountVFS(const char *containerFile, const char *mountDir);
Packit Service 672cf4
Packit Service 672cf4
    // Spawn Engine
Packit Service 672cf4
    enum SpawnFlags {
Packit Service 672cf4
        SpawnNone = 0,
Packit Service 672cf4
        SpawnDetached = 1,
Packit Service 6c01f9
        SpawnAllowSetFg = 2
Packit Service 672cf4
    };
Packit Service 672cf4
    /** Spwan the process \a file with arguments \a argv.
Packit Service 672cf4
     *
Packit Service 672cf4
     *  If a data parameter is null the /dev/null will be
Packit Service 672cf4
     *  used. (Or other platform stuff).
Packit Service 672cf4
     *
Packit Service 672cf4
     * @param file The executable to start.
Packit Service 672cf4
     * @param argv list of arguments file should be argv[0].
Packit Service 672cf4
     * @param input The data to be sent through stdin.
Packit Service 672cf4
     * @param output The data to be receive the stdout.
Packit Service 672cf4
     * @param err The data to receive stderr.
Packit Service 672cf4
     * @param flags Additional flags.
Packit Service 672cf4
     *
Packit Service 672cf4
     * @returns An error or empty error.
Packit Service 672cf4
     */
Packit Service 672cf4
    GpgME::Error spawn(const char *file, const char *argv[],
Packit Service 672cf4
                       Data &input, Data &output, Data &err,
Packit Service 672cf4
                       SpawnFlags flags);
Packit Service 672cf4
    /** Async variant of spawn. Immediately returns after starting the
Packit Service 672cf4
     * process. */
Packit Service 672cf4
    GpgME::Error spawnAsync(const char *file, const char *argv[],
Packit Service 672cf4
                            Data &input, Data &output,
Packit Service 672cf4
                            Data &err, SpawnFlags flags);
Packit Service 672cf4
    //
Packit Service 672cf4
    //
Packit Service 672cf4
    // Run Control
Packit Service 672cf4
    //
Packit Service 672cf4
    //
Packit Service 672cf4
Packit Service 672cf4
    bool poll();
Packit Service 672cf4
    GpgME::Error wait();
Packit Service 672cf4
    GpgME::Error lastError() const;
Packit Service 672cf4
    GpgME::Error cancelPendingOperation();
Packit Service 672cf4
Packit Service 672cf4
    class Private;
Packit Service 672cf4
    const Private *impl() const
Packit Service 672cf4
    {
Packit Service 672cf4
        return d;
Packit Service 672cf4
    }
Packit Service 672cf4
    Private *impl()
Packit Service 672cf4
    {
Packit Service 672cf4
        return d;
Packit Service 672cf4
    }
Packit Service 672cf4
private:
Packit Service 672cf4
    // Helper functions that need to be context because they rely
Packit Service 672cf4
    // on the "Friendlyness" of context to access the gpgme types.
Packit Service 672cf4
    gpgme_key_t *getKeysFromRecipients(const std::vector<Key> &recipients);
Packit Service 672cf4
Packit Service 672cf4
private:
Packit Service 672cf4
    Private *const d;
Packit Service 672cf4
Packit Service 672cf4
private: // disable...
Packit Service 672cf4
    Context(const Context &);
Packit Service 672cf4
    const Context &operator=(const Context &);
Packit Service 672cf4
};
Packit Service 672cf4
Packit Service 672cf4
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, Context::CertificateInclusion incl);
Packit Service 672cf4
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, Context::EncryptionFlags flags);
Packit Service 672cf4
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, Context::AuditLogFlags flags);
Packit Service 672cf4
Packit Service 672cf4
} // namespace GpgME
Packit Service 672cf4
Packit Service 672cf4
#endif // __GPGMEPP_CONTEXT_H__