signjar

package
v7.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrManifestLineEndings = errors.New("manifest has incorrect line ending sequence")

Functions

func DigestManifest

func DigestManifest(manifest []byte, hash crypto.Hash, sectionsOnly, apkV2 bool) ([]byte, error)

Transform a MANIFEST.MF into a *.SF by digesting each section with the specified hash

Types

type FilesMap

type FilesMap struct {
	Main  http.Header
	Order []string
	Files map[string]http.Header
}

func ParseManifest

func ParseManifest(manifest []byte) (files *FilesMap, err error)

func (*FilesMap) Dump

func (m *FilesMap) Dump() []byte

type JarDigest

type JarDigest struct {
	Digests  map[string]string
	Manifest []byte
	Hash     crypto.Hash
	// contains filtered or unexported fields
}

func DigestJarStream

func DigestJarStream(r io.Reader, hash crypto.Hash) (*JarDigest, error)

func (*JarDigest) Sign

func (jd *JarDigest) Sign(ctx context.Context, cert *certloader.Certificate, alias string, sectionsOnly, inlineSignature, apkV2 bool) (*binpatch.PatchSet, *pkcs9.TimestampedSignature, error)

type JarSignature

type JarSignature struct {
	pkcs9.TimestampedSignature
	SignatureHeader http.Header
	Hash            crypto.Hash
}

func Verify

func Verify(inz *zip.Reader, skipDigests bool) ([]*JarSignature, error)

Jump to

Keyboard shortcuts

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