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 }
// NewSignatureVerifierFromSSHAgent return SignatureVerifier which uses ssh-agent to verify func NewSignatureVerifierFromSSHAgent() (*SignatureVerifier, error) { keyring := gosshagent.NewKeyring() return NewSignatureVerifierFromKeyring(keyring) }
// NewSignatureCreatorFromSSHAgent return SignatureCreator which uses ssh-agent to sign func NewSignatureCreatorFromSSHAgent() (*SignatureCreator, error) { keyring := gosshagent.NewKeyring() return &SignatureCreator{keyring}, nil }