// newAuthKey returns string from an ssh.PublicKey used to index the key in our lookup. func newAuthKey(key ssh.PublicKey) string { if key == nil { return "" } // FIXME: Is there a way to index pubkeys without marshal'ing them into strings? return sshd.Fingerprint(key) }
func (i Identity) Whois() string { ip, _, _ := net.SplitHostPort(i.RemoteAddr().String()) fingerprint := "(no public key)" if i.PublicKey() != nil { fingerprint = sshd.Fingerprint(i.PublicKey()) } return fmt.Sprintf("name: %s"+message.Newline+ " > ip: %s"+message.Newline+ " > fingerprint: %s", i.Name(), ip, fingerprint) }