Documentation
¶
Overview ¶
Package localkeys finds the SSH keys of this computer that a host asking for its password offers first: the IdentityFiles ~/.ssh/config names for it, else the default key files. It also keeps, beside the app's data, which key last logged in to each host and which keys have a remembered passphrase; neither is a secret, and neither belongs in a backup, since the key files stay on this computer.
Index ¶
- Variables
- type Found
- type Remembered
- type State
- func (s *State) Forget(id string) error
- func (s *State) ForgetHost(host string) error
- func (s *State) IsRemembered(id string) bool
- func (s *State) Last(host string) string
- func (s *State) Remember(r Remembered) error
- func (s *State) Remembered() []Remembered
- func (s *State) SetLast(host, id string) error
Constants ¶
This section is empty.
Variables ¶
var Defaults = []string{"id_ed25519", "id_ecdsa", "id_rsa"}
Defaults are the key files in ~/.ssh offered when the config names none for the host, as ssh does.
Functions ¶
This section is empty.
Types ¶
type Found ¶
type Found struct {
Keys []session.LocalKey
// IdentitiesOnly is the config's option for the host.
IdentitiesOnly bool
}
Found are the keys for one host.
type Remembered ¶
type Remembered struct {
// ID is the key's session.KeyID.
ID string `json:"id"`
Path string `json:"path"`
Fingerprint string `json:"fingerprint"`
}
Remembered is a key whose passphrase is in the encrypted store (keychain.LocalKeyPassphrase).
type State ¶
type State struct {
// contains filtered or unexported fields
}
State is what SSHYard keeps about the keys of this computer, in a JSON file. It is safe for concurrent use.
func Open ¶
Open reads the state at path; a missing or unreadable file is an empty state. With path "" the state is never written.
func (*State) ForgetHost ¶
ForgetHost drops what is kept for a deleted host.
func (*State) IsRemembered ¶
IsRemembered reports whether the passphrase of the key id is remembered.
func (*State) Remember ¶
func (s *State) Remember(r Remembered) error
Remember notes that the passphrase of r is remembered.
func (*State) Remembered ¶
func (s *State) Remembered() []Remembered
Remembered are the keys with a remembered passphrase.