sshutils

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextKeySession = &struct{ string }{"session"}

ContextKeySession is the context key for the SSH session.

Functions

func KeysEqual

func KeysEqual(a, b gossh.PublicKey) bool

KeysEqual returns whether the two public keys are equal.

func MarshalAuthorizedKey

func MarshalAuthorizedKey(pk gossh.PublicKey) string

MarshalAuthorizedKey marshals a public key into an authorized key string.

This is the inverse of ParseAuthorizedKey. This function is a copy of ssh.MarshalAuthorizedKey, but without the trailing newline. It returns an empty string if pk is nil.

func ParseAuthorizedKey

func ParseAuthorizedKey(ak string) (gossh.PublicKey, string, error)

ParseAuthorizedKey parses an authorized key string into a public key.

func PublicKeyFromContext

func PublicKeyFromContext(ctx context.Context) gossh.PublicKey

PublicKeyFromContext returns the public key from the context.

func SessionFromContext

func SessionFromContext(ctx context.Context) ssh.Session

SessionFromContext returns the SSH session from the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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