File: decryptor.h

package info (click to toggle)
guncat 2.02.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 524 kB
  • sloc: cpp: 1,076; makefile: 105; sh: 37; ansic: 10
file content (43 lines) | stat: -rw-r--r-- 934 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef INCLUDED_DECRYPTOR_
#define INCLUDED_DECRYPTOR_

#include <string>
#include <fstream>
#include <memory>

class Options;
class GPGHandler;
class PGPSection;

#include <bobcat/tempstream>

class Decryptor
{
    Options const &d_options;
    GPGHandler &d_gpgHandler;

    std::unique_ptr<std::ofstream> d_fverbose;
    std::unique_ptr<FBB::TempStream> d_pgpMessage;
    std::unique_ptr<FBB::TempStream> d_decrypted;
    std::string d_decryptedName;

    public:
        Decryptor(GPGHandler &gpgHandler);
                                                // -----BEGIN PGP MESSAGE-----
                                                // was just read by
        void process(std::istream &in);         // Guncat::process

    private:
        void clearFiles() const;
        void decrypt(PGPSection const &pgpSection) const;

        void setVerbose();

        static void error(int ret, std::string const &msg);
};

#endif