Description: example code from upstream's README.md --- /dev/null +++ b/apkverifier/main.go @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/avast/apkverifier" + "os" +) + +func main() { + res, err := apkverifier.Verify(os.Args[1], nil) + if err != nil { + fmt.Fprintf(os.Stderr, "Verification failed: %s\n", err.Error()) + } + + fmt.Printf("Verification scheme used: v%d\n", res.SigningSchemeId) + cert, _ := apkverifier.PickBestApkCert(res.SignerCerts) + if cert == nil { + fmt.Printf("No certificate found.\n") + } else { + fmt.Println(cert) + } +}