oe/gpg_sign: add verify() method

A new method for verifying detached signatures.

[YOCTO #9006]

(From OE-Core rev: 4445c645c71151bd56ff7e133343a6f1e30cc3b3)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Markus Lehtonen 2016-02-10 16:15:55 +02:00 committed by Richard Purdie
parent af7e516640
commit 03554b77cd
1 changed files with 10 additions and 0 deletions

View File

@ -65,6 +65,16 @@ class LocalSigner(object):
raise bb.build.FuncFailed("Failed to create signature for '%s': %s" %
(input_file, output))
def verify(self, sig_file):
"""Verify signature"""
cmd = self.gpg_bin + " --verify "
if self.gpg_path:
cmd += "--homedir %s " % self.gpg_path
cmd += sig_file
status, _ = oe.utils.getstatusoutput(cmd)
ret = False if status else True
return ret
def get_signer(d, backend, keyid, passphrase_file):
"""Get signer object for the specified backend"""