Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PreferredKexAlgos = []string{
kexAlgoCurve25519SHA256,
kexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521,
kexAlgoDH14SHA1,
kexAlgoDHGEXSHA256,
}
PreferredKeyAlgos is aligned with the preferredKeyAlgos from golang/crypto but includes kexAlgoDHGEXSHA256 as the least preferred option.
Functions ¶
func ScanHostKey ¶
ScanHostKey collects the given host's preferred public key for the Any errors (e.g. authentication failures) are ignored, except if no key could be collected from the host.
func SetPreferredKeyAlgos ¶ added in v0.1.0
func SetPreferredKeyAlgos(config *ssh.ClientConfig)
SetPreferredKeyAlgos sets the PreferredKexAlgos on a given ClientConfig.
Types ¶
type ECDSAGenerator ¶
type ECDSAGenerator struct {
// contains filtered or unexported fields
}
func (*ECDSAGenerator) Generate ¶
func (g *ECDSAGenerator) Generate() (*KeyPair, error)
type Ed25519Generator ¶
type Ed25519Generator struct{}
func (*Ed25519Generator) Generate ¶
func (g *Ed25519Generator) Generate() (*KeyPair, error)
type HostKeyCollector ¶
type HostKeyCollector struct {
// contains filtered or unexported fields
}
HostKeyCollector offers a StoreKey method which provides an HostKeyCallBack to collect public keys from an SSH server.
func (*HostKeyCollector) GetKnownKeys ¶
func (c *HostKeyCollector) GetKnownKeys() []byte
GetKnownKeys returns the collected public keys in bytes.
func (*HostKeyCollector) StoreKey ¶
func (c *HostKeyCollector) StoreKey() ssh.HostKeyCallback
StoreKey stores the public key in bytes as returned by the host. To collect multiple public key types from the host, multiple SSH dials need with the ClientConfig HostKeyAlgorithms set to the algorithm you want to collect.
type KeyPairGenerator ¶
func NewECDSAGenerator ¶
func NewECDSAGenerator(c elliptic.Curve) KeyPairGenerator
func NewEd25519Generator ¶
func NewEd25519Generator() KeyPairGenerator
func NewRSAGenerator ¶
func NewRSAGenerator(bits int) KeyPairGenerator
type RSAGenerator ¶
type RSAGenerator struct {
// contains filtered or unexported fields
}
func (*RSAGenerator) Generate ¶
func (g *RSAGenerator) Generate() (*KeyPair, error)