ssh

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCertificate

func GetCertificate(certPath string) (*cssh.Certificate, error)

GetCertificate parses the SSH certificate at certPath and returns it as a ssh.Certificate.

func GetPublicKey

func GetPublicKey(identity string) (string, []byte, error)

GetPublicKey takes a path to a private key and finds its associated public key, reading it into memory and returning its content in byte form.

func GetPublicKeyCertPath

func GetPublicKeyCertPath(pubKeyPath string) string

GetPublicKeyCertPath takes the path to a SSH public key and returns the path to the associated signed certificate. For example, given $HOME/.ssh/id_rsa.pub it would return $HOME/.ssh/id_rsa-cert.pub.

func GetPublicKeyPath

func GetPublicKeyPath(identity string) (publicKeyPath string, err error)

GetPublicKeyPath takes the path to a private key and returns the path to its associated public key. If the given path is empty, it defaults to returning the public key for $HOME/.ssh/id_rsa.

func IsCertificateValid

func IsCertificateValid(cert *cssh.Certificate) bool

IsCertificateValid takes a SSH certificate and returns whether or not it is expired (TTL has been exceeded).

func NewSSHCommand

func NewSSHCommand(args []string) *exec.Cmd

NewSSHCommand returns a exec.Cmd type preconfigured to run the ssh binary using the given args and with all standard inputs/outputs configured to redirect the process to the end-user.

Types

This section is empty.

Jump to

Keyboard shortcuts

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