ssh

package
v0.0.0-...-811459a Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2017 License: ISC Imports: 7 Imported by: 0

Documentation

Overview

Package ssh supports generation of key pairs in different formats with as few parameters as possible

Index

Constants

View Source
const (
	// RSA1024 is 1024 bits (should only be used for testing)
	RSA1024 = 1 << (10 + iota)
	// RSA2048 is 2048 bits
	RSA2048
	// RSA4096 is 4096 bits
	RSA4096
)

Variables

This section is empty.

Functions

func LocalKeyPair

func LocalKeyPair(bits int) (private, public []byte, err error)

LocalKeyPair returns bits formatted for a local ssh key pair (id_rsa, id_rsa.pub - AuthorizedKey format)

func PrivateAndPublicKeyBytes

func PrivateAndPublicKeyBytes(bits int) ([]byte, []byte, error)

PrivateAndPublicKeyBytes takes a privateKey and returns the private and public key bytes, the public key bytes are in the wire format protocol

func ReadLocalPublicKey

func ReadLocalPublicKey(pubPath string) (out ssh.PublicKey, comment string, options []string, rest []byte, err error)

ReadLocalPublicKey reads a local path for a public key stored in the AuthorizedKeys format

func SaveNewKeyPair

func SaveNewKeyPair(privPath, pubPath string, bits int) error

SaveNewKeyPair generates a new key and saves private and public keys to a local path with the given bit

Types

This section is empty.

Jump to

Keyboard shortcuts

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