crypto

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertToPubKey

func CertToPubKey(certPEM string) (*rsa.PublicKey, error)

CertToPubKey convert a X509 PEM encoded certicate to RSA PublicKey

func EnctoFile

func EnctoFile(data []byte, path string, PubKey *rsa.PublicKey) error

EnctoFile encrypts data using RSA + AES to the publickey of the server and writes the encrypted data to disk

func GenRandString

func GenRandString() string

GenRandString generate a random string

func GetHostname

func GetHostname(path string, PubKey *rsa.PublicKey) []byte

GetHostname returns the encrypted Hostname if Hostname is not set a new Hostname is generated

func SetHostname

func SetHostname(path string, PubKey *rsa.PublicKey) error

SetHostname Sets the Hostname of the machine to a random string with the length of 16, encrypts the outcome and writes it to Disk

Types

This section is empty.

Jump to

Keyboard shortcuts

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