libzypp 17.38.8
PluginSigcheck.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
11#ifndef ZYPP_REPO_PLUGINSIGCHECK_H
12#define ZYPP_REPO_PLUGINSIGCHECK_H
13
14#include <iosfwd>
15#include <string>
16#include <vector>
17#include <map>
18
19#include <zypp-core/Pathname.h>
22
23namespace zypp
24{
28
30
35 {
37 : Exception( "SigcheckPlugin:", history_r )
38 {}
39 SigcheckPluginException( const std::string & msg_r )
40 : Exception( "SigcheckPlugin: "+msg_r )
41 {}
42 SigcheckPluginException( const std::string & msg_r, const Exception & history_r )
43 : Exception( "SigcheckPlugin: "+msg_r, history_r )
44 {}
45 };
46
48
53 {
54 public:
55 SigcheckPlugin( const SigcheckPlugin & ) = delete;
57 SigcheckPlugin( SigcheckPlugin && ) noexcept = default;
58 SigcheckPlugin & operator=( SigcheckPlugin && ) noexcept = default;
59 ~SigcheckPlugin() = default;
60
61 public:
62 using Args = std::vector<std::string>;
63
65 SigcheckPlugin( Pathname script_r );
66 SigcheckPlugin( Pathname script_r, Args args_r );
67
71 void launch( const Pathname & chroot_r = Pathname() );
72
74 std::string sigExtension() const;
75
77 std::string keyExtension() const;
78
85 void sigcheck( const Pathname & data_r, const Pathname & sig_r = Pathname(), const Pathname & key_r = Pathname() ) const;
86
87 public:
88 struct Impl;
89 private:
91 friend std::ostream & operator<<( std::ostream & str, const SigcheckPlugin & obj );
92 };
93
95
105 {
106 public:
107 SigcheckPlugins( const SigcheckPlugins & ) = delete;
109 SigcheckPlugins( SigcheckPlugins && ) noexcept = default;
110 SigcheckPlugins & operator=( SigcheckPlugins && ) noexcept = default;
111 ~SigcheckPlugins() = default;
112
113 public:
114 using Plugins = std::vector<SigcheckPlugin>;
115
118
127 SigcheckPlugins( const std::string & cmdline_r, const Pathname & plugindir_r = Pathname() );
128
130 explicit operator bool() const;
131
133 const Plugins & plugins();
134
136 void launch( const Pathname & chroot_r = Pathname() );
137
138 public:
139 struct Impl;
140 private:
142 friend std::ostream & operator<<( std::ostream & str, const SigcheckPlugins & obj );
143 };
144
145} // namespace zypp
146#endif // ZYPP_REPO_PLUGINSIGCHECK_H
Exception()
Default ctor.
Definition Exception.cc:94
std::string sigExtension() const
Extension of a signature file to retrieve.
RW_pointer< Impl > _pimpl
SigcheckPlugin(const SigcheckPlugin &)=delete
void launch(const Pathname &chroot_r=Pathname())
Launch the plugin.
void sigcheck(const Pathname &data_r, const Pathname &sig_r=Pathname(), const Pathname &key_r=Pathname()) const
Let plugin do the signature check.
std::string keyExtension() const
Extension of a key file to retrieve.
std::vector< std::string > Args
SigcheckPlugin(SigcheckPlugin &&) noexcept=default
SigcheckPlugin & operator=(const SigcheckPlugin &)=delete
SigcheckPlugins(SigcheckPlugins &&) noexcept=default
const Plugins & plugins()
All plugins (their addresses can be captured).
SigcheckPlugins(const SigcheckPlugins &)=delete
void launch(const Pathname &chroot_r=Pathname())
Launch all plugins (optionally chrooted).
SigcheckPlugins & operator=(const SigcheckPlugins &)=delete
RW_pointer< Impl > _pimpl
std::vector< SigcheckPlugin > Plugins
Definition ansi.h:855
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293
SigcheckPluginException(const std::string &msg_r)
SigcheckPluginException(const std::string &msg_r, const Exception &history_r)
SigcheckPluginException(const Exception &history_r)