Documentation ¶
Overview ¶
Package ssh implements functionality associated with ssh agent.
Index ¶
- Variables
- func Agent() (ag.Agent, net.Conn, error)
- func AgentBySocket(socketPath string) (ag.Agent, net.Conn, error)
- func AgentConn() (net.Conn, error)
- func ChallengeSSHAgent(a ag.Agent, key ssh.PublicKey) error
- func CheckSSHAuthSock() (string, error)
- func ListKeys(agent ag.Agent, filter keyFilter) ([]ag.Key, error)
- type AgentKey
- type KeyOpt
Constants ¶
This section is empty.
Variables ¶
var DefaultKeyOpt = KeyOpt{ KeyRefreshFilter: func(key *agent.Key) bool { return false }, PrivateKeyValiditySec: defaultKeyValiditySec, PublicKeyAlgo: defaultPublicKeyAlgo, PrivateKeyLabel: defaultPrivateKeyLabel, CertLabel: defaultCertLabel, }
DefaultKeyOpt is the default option of keyAgent.
Functions ¶
func AgentBySocket ¶
AgentBySocket returns the ssh-agent and its connection by the socket.
func ChallengeSSHAgent ¶
ChallengeSSHAgent verifies the given public key using challenge-response authentication.
func CheckSSHAuthSock ¶
CheckSSHAuthSock checks for presence of ssh agent and if one present, returns the value of SSH_AUTH_SOCK environment variable.
Types ¶
type AgentKey ¶
type AgentKey struct {
// contains filtered or unexported fields
}
AgentKey represents an SSH key pair in ssh-agent. It also stores the CSRs of the key pair.
func NewSSHAgentKey ¶
NewSSHAgentKey initializes an SSHAgentKey from the network connection.
func NewSSHAgentKeyWithOpt ¶
NewSSHAgentKeyWithOpt initializes an AgentKey from the network connection and the opt.
func (*AgentKey) AddCertsToAgent ¶
AddCertsToAgent add the certificates to ssh agent.