22 using namespace zyppng::operators;
24 template <
class Executor,
class OpType>
25 struct VerifySignatureLogic :
public LogicBase<Executor,OpType> {
28 using ZyppContextRefType = MaybeAsyncContextRef<OpType>;
30 VerifySignatureLogic( ZyppContextRefType &&zyppCtx, zypp::keyring::VerifyFileContext &&ctx )
31 : _zyppCtx( std::move(zyppCtx) )
32 , _verifyCtx( std::move(ctx) ) { }
34 MaybeAsyncRef<expected<zypp::keyring::VerifyFileContext>> execute () {
36 const zypp::Pathname & sig { _verifyCtx.signature() };
37 if ( not ( sig.
empty() || zypp::PathInfo(sig).isExist() ) ) {
41 MIL <<
"Checking " << _verifyCtx.file ()<<
" file validity using digital signature.." << std::endl;
52 ZyppContextRefType _zyppCtx;
53 zypp::keyring::VerifyFileContext _verifyCtx;
const std::string & asString() const
String representation.
bool empty() const
Test for an empty path.
I/O context for KeyRing::verifyFileSignatureWorkflow.
static expected success(ConsParams &&...params)
#define ZYPP_ENABLE_LOGIC_BASE(Executor, OpType)
std::pair< bool, zypp::keyring::VerifyFileContext > verifyFileSignature(SyncContextRef zyppContext, zypp::keyring::VerifyFileContext &&context_r)
Follows a signature verification interacting with the user.
expected< zypp::keyring::VerifyFileContext > verifySignature(SyncContextRef ctx, zypp::keyring::VerifyFileContext context)
std::conditional_t< isAsync, AsyncOpRef< T >, T > makeReadyResult(T &&result)
std::shared_ptr< AsyncOp< T > > AsyncOpRef
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.