safetynet

package module
v2.0.0-...-19c5646 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllVendors = []Vendor{VendorGMS, VendorHMS}
View Source
var ErrUnknownVendor = errors.New("safetynet: valid certificate found but not from any known safetynet vendors")
View Source
var ErrorBasicIntegrity = errors.New("basic integrity check fail")
View Source
var ErrorSafetyNetDecode = errors.New("cannot decode token")
View Source
var ErrorSafetyNetError = errors.New("safetyNet report error")
View Source
var TimeFunction = time.Now

for mocking

Functions

This section is empty.

Types

type Attestation

type Attestation struct {
	Timestamp                  int64    `json:"timestampMs"`
	Nonce                      string   `json:"nonce"`
	ApkPackageName             string   `json:"apkPackageName"`
	ApkDigestSHA256            string   `json:"apkDigestSha256"`
	ApkCertificateDigestSHA256 []string `json:"apkCertificateDigestSha256"`
	CTSProfileMatch            bool     `json:"ctsProfileMatch"`
	BasicIntegrity             bool     `json:"basicIntegrity"`
	Advice                     string   `json:"advice,omitempty"`
	Error                      string   `json:"error,omitempty"`
	Vendor                     Vendor   `json:"vendor"`
}

func Validate

func Validate(token string) (out Attestation, err error)

func (Attestation) GetTimestamp

func (s Attestation) GetTimestamp() time.Time

type Vendor

type Vendor string
const (
	VendorGMS Vendor = "attest.android.com"
	VendorHMS Vendor = "sysintegrity.platform.hicloud.com"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL