Example #1
0
func initSign(t *testing.T) (*SignatureCreator, *SignatureVerifier) {
	keyring := gosshagent.NewKeyring()

	keyring.Add(testPrivateKeys["rsa"], nil, "")

	c := NewSignatureCreator(keyring)
	v, err := NewSignatureVerifierFromKeyring(keyring)
	if err != nil {
		t.Fatal("Failed to initialize signature verifier:", err)
	}

	return c, v
}
Example #2
0
// NewSignatureVerifierFromSSHAgent return SignatureVerifier which uses ssh-agent to verify
func NewSignatureVerifierFromSSHAgent() (*SignatureVerifier, error) {
	keyring := gosshagent.NewKeyring()
	return NewSignatureVerifierFromKeyring(keyring)
}
Example #3
0
// NewSignatureCreatorFromSSHAgent return SignatureCreator which uses ssh-agent to sign
func NewSignatureCreatorFromSSHAgent() (*SignatureCreator, error) {
	keyring := gosshagent.NewKeyring()
	return &SignatureCreator{keyring}, nil
}