问题描述
func VerifyGPGSig(target,signature,signingKey string) error {
keyRingReader,err := os.Open(signingKey)
if err != nil {
return fmt.Errorf("Failed to open %s: %v",signingKey,err)
}
sig,err := os.Open(signature)
if err != nil {
return fmt.Errorf("Failed to open %s: %v",err)
}
t,err := os.Open(target)
if err != nil {
return fmt.Errorf("Failed to open %s: %v",target,err)
}
keyring,err := openpgp.ReadArmoredKeyRing(keyRingReader)
if err != nil {
return fmt.Errorf("Failed to read signing key: %v",err)
}
_,err = openpgp.CheckArmoredDetachedSignature(keyring,t,sig)
if err != nil && err == io.EOF {
// When the signature is binary instead of armored,the error is io.EOF.
// Let's try with binary signatures as well
_,err := openpgp.CheckDetachedSignature(keyring,sig)
if err != nil && err == io.EOF {
return fmt.Errorf("Failed to find valid signatures in the signature file: %v",err)
}
return fmt.Errorf("Failed to check signature: %v",err)
}
if err != nil {
return fmt.Errorf("Failed to check signature: %v",err)
}
return nil
}
Failed to check signature: openpgp: signature made by unkNown entity
从这里https://www.flatcar-linux.org/security/image-signing-key/Flatcar_Image_Signing_Key.asc
下载了GPG密钥我没有找到要添加到公钥PGP密钥的任何基元。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)