Documentation ¶
Index ¶
Constants ¶
const DefaultAuthorizedKeysFile = "~/.ssh/authorized_keys"
Variables ¶
This section is empty.
Functions ¶
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 ¶
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