crypto

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RSA_BITS     = 2048 // Default number of bits in an RSA key
	RSA_BITS_MIN = 768  // Minimum number of bits in an RSA key
)

Variables

This section is empty.

Functions

func Encrypt

func Encrypt(in, privKey string) (string, error)

Encrypt encrypts a secret string.

func GeneratePrivateKey

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

helper function to generate an RSA Private Key.

func MarshalPrivateKey

func MarshalPrivateKey(private *rsa.PrivateKey) []byte

helper function that marshalls an RSA Private Key to a PEM encoded file.

func MarshalPublicKey

func MarshalPublicKey(public *rsa.PublicKey) []byte

helper function that marshalls an RSA Public Key to an SSH .authorized_keys format

func Rand

func Rand() string

Rand generates a 32-bit random string.

func UnmarshalPrivateKey

func UnmarshalPrivateKey(private []byte) *rsa.PrivateKey

UnmarshalPrivateKey is a helper function that unmarshals a PEM bytes to an RSA Private Key

Types

This section is empty.

Jump to

Keyboard shortcuts

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