util

package
v0.0.0-...-b64e6e3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodePrivateKeyToPEM

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

encodePrivateKeyToPEM encodes Private Key from RSA to PEM format

func Exists

func Exists(path string) bool

func GeneratePrivateKey

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

https://gist.github.com/devinodaniel/8f9b8a4f31573f428f29ec0e884e6673 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 WriteKeyToFile

func WriteKeyToFile(keyBytes []byte, saveFileTo string) error

writePemToFile writes keys to a file

Types

This section is empty.

Jump to

Keyboard shortcuts

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