crypto

package
v0.0.0-...-4bb0fba Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEndOfRecord      = errors.New("end of record")
	ErrInvalidPortValue = errors.New("invalid port value")
)

Functions

func EncodePrivateKeyToPEM

func EncodePrivateKeyToPEM(privateKey *rsa.PrivateKey) []byte

encodePrivateKeyToPEM encodes Private Key from RSA to PEM format

func GeneratePrivateKey

func GeneratePrivateKey(bitSize int) (*rsa.PrivateKey, error)

generatePrivateKey creates a RSA Private Key of specified byte size

func GeneratePublicKey

func GeneratePublicKey(privatekey *rsa.PublicKey) ([]byte, error)

generatePublicKey take a rsa.PublicKey and return bytes suitable for writing to .pub file returns in the format "ssh-rsa ..."

func TryCreateMachineSshCertificate

func TryCreateMachineSshCertificate(settings *config.Settings) error

TryCreateMachineSshCertificate - creates a Cert for SSH access of the new machine if the user didn't provide one in settings

func TryWriteSshConfigFile

func TryWriteSshConfigFile(username string, sshDirectory string, certFileName string) error

TryWriteSshConfigFile will try to create, or append to .ssh/config if the entry exist - no update is performed

Types

type ConfigEntry

type ConfigEntry struct {
	Host   string
	Fields map[string]string
}

func (ConfigEntry) Compare

func (e1 ConfigEntry) Compare(e2 ConfigEntry) bool

type Field

type Field struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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