knownhosts

package
v0.0.0-...-8488f5b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2016 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HostKeyMismatchError = errors.New("knownhosts: Host key doesn't match")
View Source
var HostNotFoundError = errors.New("knownhosts: Host is unknown")
View Source
var HostRevokedError = errors.New("knownhosts: Host is revoked")
View Source
var UnsupportedAddrType = errors.New("knownhosts: remote must be a *net.TCPAddr")

Functions

This section is empty.

Types

type Host

type Host struct {
	Hash           *hostHash
	Pattern        *regexp.Regexp
	PatternNegated bool
	PatternRaw     string
	Addr           string
	Port           string
	// contains filtered or unexported fields
}

func (*Host) Marshal

func (h *Host) Marshal() []byte

func (*Host) Match

func (h *Host) Match(hostname string, addr *net.TCPAddr) bool

type KnownHosts

type KnownHosts []*Line

func Unmarshal

func Unmarshal(in io.Reader) (*KnownHosts, error)

func (*KnownHosts) AppendHost

func (k *KnownHosts) AppendHost(hostname string, key ssh.PublicKey, out io.Writer) error

func (KnownHosts) HostKeyCallback

func (k KnownHosts) HostKeyCallback(hostname string, remote net.Addr, key ssh.PublicKey) error

func (KnownHosts) Marshal

func (k KnownHosts) Marshal(out io.Writer) error

type Line

type Line struct {
	Hosts         []*Host
	Revoked       bool
	CertAuthority bool
	PublicKey     ssh.PublicKey
}

func (*Line) Marshal

func (l *Line) Marshal() ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL