libzypp: zypp/KeyRingContexts.h Source File

libzypp 17.38.5

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-core/base/PtrTypes.h>
19
20#include <zypp-core/Pathname.h>
21#include <zypp/KeyContext.h>
22
24namespace zypp::keyring
25{
29 class ZYPP_API VerifyFileContext
30 {
31 public:
33 VerifyFileContext();
35 explicit VerifyFileContext( Pathname file_r );
37 VerifyFileContext( Pathname file_r, Pathname signature_r );
38
39 VerifyFileContext(const VerifyFileContext &) = default;
40 VerifyFileContext(VerifyFileContext &&) noexcept = default;
41
42 VerifyFileContext &operator=(const VerifyFileContext &) = default;
43 VerifyFileContext &operator=(VerifyFileContext &&) noexcept = default;
44
45 ~VerifyFileContext();
46
48 const Pathname & file() const;
49 void file( Pathname file_r );
50
52 const Pathname & signature() const;
53 void signature( Pathname signature_r );
54
56 std::string shortFile() const;
57 void shortFile( std::string shortFile_r );
58
60 const KeyContext & keyContext() const;
61 void keyContext( KeyContext keyContext_r );
62
64 using BuddyKeys = std::set<std::string>;
65 const BuddyKeys & buddyKeys() const;
66 void addBuddyKey( std::string sid_r );
67
71
72 void resetResults();
73
75 bool fileAccepted() const;
76 void fileAccepted( bool yesno_r) ;
77
79 bool fileValidated() const;
80 void fileValidated( bool yesno_r );
81
83 const std::string & signatureId() const;
84 void signatureId( std::string signatureId_r );
85
87 bool signatureIdTrusted() const;
88 void signatureIdTrusted( bool yesno_r );
90 public:
91 class Impl;
92 private:
93 RWCOW_pointer<Impl> _pimpl;
94 };
95
97 std::ostream & operator<<( std::ostream & str, const VerifyFileContext & obj );
98
99} // namespace zypp::keyring
101#endif // ZYPP_KEYRINGCONTEXTS_H
KeyContext.h
Pathname.h
PtrTypes.h
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp::keyring::VerifyFileContext::Impl
Directly accessed by verifyFileSignatureWorkflow to set the result data.
Definition KeyRingContexts.cc:25
zypp::keyring::VerifyFileContext::fileValidated
bool fileValidated() const
Whether the signature was actually successfully verified.
Definition KeyRingContexts.cc:113
zypp::keyring::VerifyFileContext::BuddyKeys
std::set< std::string > BuddyKeys
List of key safe key ids to import IFF fileValidated.
Definition KeyRingContexts.h:64
zypp::keyring::VerifyFileContext::VerifyFileContext
VerifyFileContext(VerifyFileContext &&) noexcept=default
zypp::keyring::VerifyFileContext::keyContext
const KeyContext & keyContext() const
KeyContext passed to callbacks
Definition KeyRingContexts.cc:91
zypp::keyring::VerifyFileContext::shortFile
std::string shortFile() const
Short name for file (default: basename).
Definition KeyRingContexts.cc:85
zypp::keyring::VerifyFileContext::_pimpl
RWCOW_pointer< Impl > _pimpl
Implementation.
Definition KeyRingContexts.h:93
zypp::keyring::VerifyFileContext::file
const Pathname & file() const
File to verify.
Definition KeyRingContexts.cc:73
zypp::keyring::VerifyFileContext::buddyKeys
const BuddyKeys & buddyKeys() const
Definition KeyRingContexts.cc:97
zypp::keyring::VerifyFileContext::signatureIdTrusted
bool signatureIdTrusted() const
Whether the SignatureId is in the trusted keyring (not temp.
Definition KeyRingContexts.cc:125
zypp::keyring::VerifyFileContext::VerifyFileContext
VerifyFileContext()
Ctor.
Definition KeyRingContexts.cc:60
zypp::keyring::VerifyFileContext::VerifyFileContext
VerifyFileContext(const VerifyFileContext &)=default
zypp::keyring::VerifyFileContext::signature
const Pathname & signature() const
Detached signature or empty.
Definition KeyRingContexts.cc:79
zypp::keyring::VerifyFileContext::resetResults
void resetResults()
Reset all result values to safe defaults.
Definition KeyRingContexts.cc:104
zypp::keyring::VerifyFileContext::signatureId
const std::string & signatureId() const
The id of the gpg key which signed the file.
Definition KeyRingContexts.cc:119
zypp::keyring::VerifyFileContext::fileAccepted
bool fileAccepted() const
May return true due to user interaction or global defaults even if the signature was not actually ver...
Definition KeyRingContexts.cc:107
zypp::keyring::VerifyFileContext::addBuddyKey
void addBuddyKey(std::string sid_r)
Definition KeyRingContexts.cc:100
std
Definition ansi.h:855
str
String related utilities and Regular expression matching.
zypp::keyring
Definition KeyRingContexts.cc:18
zypp::ZYPP_API
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
zypp::KeyContext
Definition KeyContext.h:9
zypp::RWCOW_pointer
RW_pointer supporting 'copy on write' functionality.
Definition PtrTypes.h:469