ssh

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlgorithmDefaultKeyLength added in v0.0.2

func AlgorithmDefaultKeyLength(algo Algorithm) int32

func AlgorithmToString added in v0.0.2

func AlgorithmToString(algo Algorithm) string

func GenerateKeyPair

func GenerateKeyPair(algo Algorithm, keyLength int, password string) (privateKey, publicKey string, err error)

GenerateKeyPair generates a password protected SSH key pair.

func GetPublicKey

func GetPublicKey(privateKey string, password string) (string, error)

GetPublicKey extracts the public key from a private key string using the given password.

func IsValidPrivateKey

func IsValidPrivateKey(key string) bool

IsValidPrivateKey checks if a given string represents a valid private key.

Types

type Algorithm

type Algorithm int

Algorithm represents the SSH key algorithm.

const (
	ECDSA Algorithm = iota
	RSA
)

func AlgorithmFromString added in v0.0.2

func AlgorithmFromString(str string) Algorithm

func GetAvailableAlgorithms added in v0.0.2

func GetAvailableAlgorithms() []Algorithm

Jump to

Keyboard shortcuts

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