sign

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package sign adds signatures to matchbox responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadGPGEntity

func LoadGPGEntity(keyRingPath, passphrase string) (*openpgp.Entity, error)

LoadGPGEntity loads a key ring file, unlocks the first key using the given passphrase, and returns a new OpenPGP Entity for signing.

func SignatureHandler

func SignatureHandler(signer Signer, next http.Handler) http.Handler

SignatureHandler wraps an http.Handler and responds with the signature of the response from the wrapped handler using the given signer.

Types

type Signer

type Signer interface {
	Sign(w io.Writer, message io.Reader) error
}

A Signer signs messages and writes detached signatures to w.

func NewArmoredGPGSigner

func NewArmoredGPGSigner(signer *openpgp.Entity) Signer

NewArmoredGPGSigner returns a new Signer that reads messages and writes ascii armored OpenPGP signatures.

func NewGPGSigner

func NewGPGSigner(signer *openpgp.Entity) Signer

NewGPGSigner returns a new Signer that reads messages and writes OpenPGP signatures.

Jump to

Keyboard shortcuts

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