sign

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2014 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAuthorizedKeysFile = "~/.ssh/authorized_keys"
)

Variables

View Source
var (
	ErrMalformedResp = errors.New("malformed signature response from agent client")
)

Functions

func TagForPayload

func TagForPayload(name string) string

TagForPayload returns tag used for payload

Types

type SignatureCreator

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

func NewSignatureCreator

func NewSignatureCreator(keyring gosshagent.Agent) *SignatureCreator

func NewSignatureCreatorFromSSHAgent

func NewSignatureCreatorFromSSHAgent() (*SignatureCreator, error)

NewSignatureCreatorFromSSHAgent return SignatureCreator which uses ssh-agent to sign

func (*SignatureCreator) Sign

func (sc *SignatureCreator) Sign(tag string, data []byte) (*SignatureSet, error)

Sign generates signature for the data labled by tag

func (*SignatureCreator) SignPayload

func (sc *SignatureCreator) SignPayload(jp *job.JobPayload) (*SignatureSet, error)

SignPayload signs the payload

type SignatureSet

type SignatureSet struct {
	Tag   string
	Signs []*gossh.Signature
}

type SignatureVerifier

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

func NewSignatureVerifier

func NewSignatureVerifier() *SignatureVerifier

func NewSignatureVerifierFromAuthorizedKeysFile

func NewSignatureVerifierFromAuthorizedKeysFile(filepath string) (*SignatureVerifier, error)

NewSignatureVerifierFromAuthorizedKeysFile return SignatureVerifier which uses authorized key file to verify

func NewSignatureVerifierFromKeyring

func NewSignatureVerifierFromKeyring(keyring gosshagent.Agent) (*SignatureVerifier, error)

NewSignatureVerifierFromKeyring return SignatureVerifier which uses public keys fetched from keyring to verify

func NewSignatureVerifierFromSSHAgent

func NewSignatureVerifierFromSSHAgent() (*SignatureVerifier, error)

NewSignatureVerifierFromSSHAgent return SignatureVerifier which uses ssh-agent to verify

func (*SignatureVerifier) Verify

func (sv *SignatureVerifier) Verify(data []byte, s *SignatureSet) (bool, error)

Verify verifies whether or not data fits the signature

func (*SignatureVerifier) VerifyPayload

func (sc *SignatureVerifier) VerifyPayload(jp *job.JobPayload, s *SignatureSet) (bool, error)

VerifyPayload verifies the payload using signature

Jump to

Keyboard shortcuts

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