libzypp 17.31.23
zypp::SignatureFileChecker Class Reference

Checks for the validity of a signature. More...

#include <FileChecker.h>

Inheritance diagram for zypp::SignatureFileChecker:

Public Types

typedef SignatureCheckException ExceptionType
- Public Types inherited from zypp::keyring::VerifyFileContext
typedef std::set< std::string > BuddyKeys
 List of key safe key ids to import IFF fileValidated.

Public Member Functions

 SignatureFileChecker ()
 Default Ctor for unsigned files.
 SignatureFileChecker (Pathname signature_r)
 Ctor taking the detached signature.
void addPublicKey (const PublicKey &publickey_r)
 Add a public key to the list of known keys.
void addPublicKey (const Pathname &publickey_r)
void operator() (const Pathname &file_r) const
 Call KeyRing::verifyFileSignatureWorkflow to verify the file.
- Public Member Functions inherited from zypp::keyring::VerifyFileContext
 VerifyFileContext ()
 VerifyFileContext (Pathname file_r)
 Ctor may take file to verify and detatched signature.
 VerifyFileContext (Pathname file_r, Pathname signature_r)
 Ctor may take file to verify and detatched signature.
 ~VerifyFileContext ()
const Pathnamefile () const
 File to verify.
void file (Pathname file_r)
const Pathnamesignature () const
 Detached signature or empty.
void signature (Pathname signature_r)
std::string shortFile () const
 Short name for file (default: basename).
void shortFile (std::string shortFile_r)
const KeyContextkeyContext () const
 KeyContext passed to callbacks
void keyContext (KeyContext keyContext_r)
const BuddyKeysbuddyKeys () const
void addBuddyKey (std::string sid_r)
void resetResults ()
 Reset all result values to safe defaults.
bool fileAccepted () const
 May return true due to user interaction or global defaults even if the signature was not actually verified.
void fileAccepted (bool yesno_r)
bool fileValidated () const
 Whether the signature was actually successfully verified.
void fileValidated (bool yesno_r)
const std::string & signatureId () const
 The id of the gpg key which signed the file.
void signatureId (std::string signatureId_r)
bool signatureIdTrusted () const
 Whether the SignatureId is in the trusted keyring (not temp.
void signatureIdTrusted (bool yesno_r)

Additional Inherited Members

Detailed Description

Checks for the validity of a signature.

Definition at line 70 of file FileChecker.h.

Member Typedef Documentation

◆ ExceptionType

Constructor & Destructor Documentation

◆ SignatureFileChecker() [1/2]

zypp::SignatureFileChecker::SignatureFileChecker ( )

Default Ctor for unsigned files.

Use it when you don't have a signature and you want to check whether the user accepts an unsigned file.

Definition at line 112 of file

◆ SignatureFileChecker() [2/2]

zypp::SignatureFileChecker::SignatureFileChecker ( Pathname  signature_r)

Ctor taking the detached signature.

Definition at line 115 of file

Member Function Documentation

◆ addPublicKey() [1/2]

void zypp::SignatureFileChecker::addPublicKey ( const PublicKey publickey_r)

Add a public key to the list of known keys.

Definition at line 121 of file

◆ addPublicKey() [2/2]

void zypp::SignatureFileChecker::addPublicKey ( const Pathname publickey_r)

Definition at line 118 of file

◆ operator()()

void zypp::SignatureFileChecker::operator() ( const Pathname file_r) const

Call KeyRing::verifyFileSignatureWorkflow to verify the file.

Keep in mind the the workflow may return true (\refr fileAccepted) due to user interaction or global defaults even if a signature was not actually sucessfully verified. Whether a signature was actually sucessfully verified can be determined by checking fileValidated which is invokes IFF a signature for this file actually validated.

file_rFile to validate.
SignatureCheckExceptionif validation fails

Definition at line 124 of file

The documentation for this class was generated from the following files: