sign

package
v0.3.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2014 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func TagForJob added in v0.3.0

func TagForJob(jobName string) string

TagForJob returns a tag used to identify and store signatures for a Job

Types

type SignatureCreator

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

SignatureCreator provides the ability to sign a blob of data with multiple SSH public keys, contained in the keyring

func NewSignatureCreator

func NewSignatureCreator(keyring gosshagent.Agent) *SignatureCreator

NewSignatureCreator instantiates a SignatureCreator with the given keyring

func NewSignatureCreatorFromSSHAgent

func NewSignatureCreatorFromSSHAgent() (*SignatureCreator, error)

NewSignatureCreatorFromSSHAgent return a SignatureCreator which uses the local ssh-agent as its keyring

func (*SignatureCreator) Sign

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

Sign generates a SignatureSet for the given data, labelled by the supplied tag. It returns a *SignatureSet and any error encountere

func (*SignatureCreator) SignJob added in v0.3.0

func (sc *SignatureCreator) SignJob(j *job.Job) (*SignatureSet, error)

SignJob signs the provided Job's Unit, returning a SignatureSet

type SignatureSet

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

SignatureSet contains a set of SSH signatures for a blob of data, and is named by a Tag.

type SignatureVerifier

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

func NewSignatureVerifier

func NewSignatureVerifier() *SignatureVerifier

func NewSignatureVerifierFromAuthorizedKeysFile

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

NewSignatureVerifierFromAuthorizedKeysFile creates a SignatureVerifier which uses public keys from the specified authorized_keys file to verify signatures

func NewSignatureVerifierFromKeyring

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

NewSignatureVerifierFromKeyring creates a SignatureVerifier which uses public keys from the given keyring to verify signatures

func NewSignatureVerifierFromSSHAgent

func NewSignatureVerifierFromSSHAgent() (*SignatureVerifier, error)

NewSignatureVerifierFromSSHAgent return SignatureVerifier which uses public keys in the local ssh-agent to verify signatures

func (*SignatureVerifier) Verify

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

Verify verifies that at least one of the signatures in the provided SignatureSet is a valid signature of the given data blob.

func (*SignatureVerifier) VerifyJob added in v0.3.0

func (sv *SignatureVerifier) VerifyJob(j *job.Job, ss *SignatureSet) (bool, error)

VerifyJob verifies the provided Job's Unit using the given SignatureSet

Jump to

Keyboard shortcuts

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