libzypp  17.30.0
KeyRingContexts.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
11 #ifndef ZYPP_KEYRINGCONTEXTS_H
12 #define ZYPP_KEYRINGCONTEXTS_H
13 
14 #include <iosfwd>
15 #include <string>
16 #include <set>
17 
18 #include <zypp/base/PtrTypes.h>
19 
20 #include <zypp/Pathname.h>
21 #include <zypp/KeyContext.h>
22 
24 namespace zypp::keyring
25 {
30  {
31  public:
35  explicit VerifyFileContext( Pathname file_r );
37  VerifyFileContext( Pathname file_r, Pathname signature_r );
38 
40 
42  const Pathname & file() const;
43  void file( Pathname file_r );
44 
46  const Pathname & signature() const;
47  void signature( Pathname signature_r );
48 
50  std::string shortFile() const;
51  void shortFile( std::string shortFile_r );
52 
54  const KeyContext & keyContext() const;
55  void keyContext( KeyContext keyContext_r );
56 
58  typedef std::set<std::string> BuddyKeys;
59  const BuddyKeys & buddyKeys() const;
60  void addBuddyKey( std::string sid_r );
61 
66  void resetResults();
67 
69  bool fileAccepted() const;
70  void fileAccepted( bool yesno_r) ;
71 
73  bool fileValidated() const;
74  void fileValidated( bool yesno_r );
75 
77  const std::string & signatureId() const;
78  void signatureId( std::string signatureId_r );
79 
81  bool signatureIdTrusted() const;
82  void signatureIdTrusted( bool yesno_r );
84  public:
85  struct Impl;
86  private:
88  };
89 
91  std::ostream & operator<<( std::ostream & str, const VerifyFileContext & obj );
92 
93 } // namespace zypp::keyring
95 #endif // ZYPP_KEYRINGCONTEXTS_H
Directly accessed by verifyFileSignatureWorkflow to set the result data.
I/O context for KeyRing::verifyFileSignatureWorkflow.
std::set< std::string > BuddyKeys
List of key safe key ids to import IFF fileValidated.
bool fileValidated() const
Whether the signature was actually successfully verified.
const KeyContext & keyContext() const
KeyContext passed to callbacks
std::string shortFile() const
Short name for file (default: basename).
RWCOW_pointer< Impl > _pimpl
Implementation.
const Pathname & file() const
File to verify.
const BuddyKeys & buddyKeys() const
bool signatureIdTrusted() const
Whether the SignatureId is in the trusted keyring (not temp.
const Pathname & signature() const
Detached signature or empty.
void resetResults()
Reset all result values to safe defaults.
const std::string & signatureId() const
The id of the gpg key which signed the file.
bool fileAccepted() const
May return true due to user interaction or global defaults even if the signature was not actually ver...
void addBuddyKey(std::string sid_r)
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const VerifyFileContext &obj)