licensekey

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2016 License: BSD-2-Clause, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeys

func GenerateKeys(bits int) (*rsa.PrivateKey, error)

GenerateKeys generates RSA public and private keys with a given bit strength.

func LoadPrivateKey

func LoadPrivateKey(path string) (*rsa.PrivateKey, error)

LoadPrivateKey loads a RSA private key as PEM from disk.

func LoadPublicKey

func LoadPublicKey(path string) (*rsa.PublicKey, error)

LoadPublicKey loads a RSA public key as PEM from disk.

func PrivateKeyFromBytes

func PrivateKeyFromBytes(data []byte) (*rsa.PrivateKey, error)

PrivateKeyFromBytes parses a RSA private key as PEM from bytes.

func PublicKeyFromBytes

func PublicKeyFromBytes(data []byte) (*rsa.PublicKey, error)

PublicKeyFromBytes parses a RSA public key as PEM from bytes.

func Sign

func Sign(key *rsa.PrivateKey, msg []byte) ([]byte, error)

Sign RSA PKCS#1 v1.5 signs a message with a given private key.

func StorePrivateKey

func StorePrivateKey(privateKey *rsa.PrivateKey, path string) error

StorePrivateKey stores a RSA private key as PEM on disk.

func StorePublicKey

func StorePublicKey(publicKey *rsa.PublicKey, path string) error

StorePublicKey stores a RSA public key as PEM on disk.

func Verify

func Verify(key *rsa.PublicKey, msg []byte, sig []byte) error

Verify RSA PKCS#1 v1.5 verifies a signature against a message with a given public key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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