index

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Concat added in v0.2.0

func Concat(b1 io.Reader, b2 io.Reader) io.Reader

Concat concatenates readers. Used for concatenating signature.tar.gz and APKINDEX.unsigned.tar.gz.

func ReadApkIndex

func ReadApkIndex(f io.Reader) (*apkutils.ApkIndex, error)

ReadApkIndex reads an APKINDEX file to a ApkIndex struct.

func SignApkIndex added in v0.2.0

func SignApkIndex(b []byte, signer Signer, pubkeyname string) (*bytes.Buffer, error)

SignApkIndex signs an APKINDEX file buffer using a sha1 digest using a prviate key file. The resulting file has the name format .SIGN.RSA.<nameof-public-key>.

Types

type Signer added in v0.2.0

type Signer interface {
	// Sign returns raw signature for the given data. This method
	// will apply the hash specified for the keytype to the data.
	Sign(data []byte) ([]byte, error)
}

A Signer is can create signatures that verify against a public key.

func LoadPrivateKey added in v0.2.4

func LoadPrivateKey(path string) (Signer, error)

LoadPrivateKey loads an parses a PEM encoded private key file and returns a Signer

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer provides sequential writing of APKINDEX index entries from APK files

func NewWriter

func NewWriter(w io.Writer) *Writer

NewWriter create a new writer.

func (*Writer) Close

func (w *Writer) Close()

Close closes the underlying writer, by writing a \n line.

func (*Writer) Write

func (w *Writer) Write(entry *apkutils.IndexEntry)

Write writes a APKINDEX record to the underlying writer.

func (*Writer) WriteApk added in v0.1.3

func (w *Writer) WriteApk(apk *apkutils.ApkFile)

WriteApk writes a APK file to an APKINDEX file, ie. a APKINDEX record for the APK.

Jump to

Keyboard shortcuts

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