Debian Codegraph @

/

debian golang-github-avast-apkverifier 0.0~git20191015.7330a51-11debian golang-github-avast-apkverifier-dev debian apkverifier debiangoinimakefilemarkdownshellyaml 75 files · 90 symbols
View dependency graph

Depends on

README (full)

apkverifier

GoDoc Build Status

APK signature verification, should support all algorithms and both scheme v1 and v2, including downgrade attack protection.

Works with Go 1.8 or higher.

Documentation on GoDoc

go get github.com/avast/apkverifier

Vendored stuff

Because Android can handle even broken x509 cerficates and ZIP files, apkverifier is using the ZipReader from apkparser package and vendors crypto/x509 in internal/x509andr and github.com/fullsailor/pkcs7 in the fullsailor/pkcs7 folder. The last two have some changes to handle some not-entirely-according-to-spec certificates.

Example

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)
	}
}

dir apkverifier/
dir debian/
dir fullsailor/
dir internal/
dir signingblock/
file .gitignore
file .travis.yml
file LICENSE
file README.md
file apkverifier.go
file apkverifier_test.go
file certinfo.go
file go.mod
file go.sum
file manifest.go
file runtests.sh
file schemev1.go