...

Package signjar

import "github.com/sassoftware/relic/lib/signjar"
Overview
Index

Overview ▾

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

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)