key

package
v0.0.0-...-8b9d493 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign

func Sign(req Requester, privKey, toSign File) (string, error)

Sign is used to sign a file using a private key. A password will be requested if privKey is encrypted.

func Verify

func Verify(pubKey, signature, msg File) error

Verify verifies a message using a signature file and a public ssh key.

Types

type File

type File interface {
	Read([]byte) (int, error)
	Name() string
}

File represents a file-like object to the functions in this package.

type Requester

type Requester interface {
	// Passphrase requests a passphrase for a file at path.
	Passphrase(path string) ([]byte, error)
}

Requester is a type which can request information from a user dynamically.

type VerifyError

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

VerifyError is an error type signaling that verification failed.

func (VerifyError) Error

func (e VerifyError) Error() string

Error implements error.

Jump to

Keyboard shortcuts

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