rsakey

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFile

func LoadFile(path string) ([]byte, error)

Types

type RsaKey

type RsaKey struct {
	// Rsa private key
	PrivateKey *rsa.PrivateKey

	// Rsa private key
	PrivateKeyBytes []byte

	// Rsa public key
	PublicKey *RsaPublicKey
}

func CreateRsaKey

func CreateRsaKey() (*RsaKey, error)

create new rsa key

func NewRsaKey deprecated

func NewRsaKey(rsaDir string) (*RsaKey, error)

Deprecated: Replace with NewRsaPrivateKey NewRsaKey creates a keystore for the given directory.

func NewRsaPrivateKey

func NewRsaPrivateKey(priKeyBytes []byte) (*RsaKey, error)

func (*RsaKey) RsaDecrypt

func (ks *RsaKey) RsaDecrypt(cipherText []byte) ([]byte, error)

func (*RsaKey) RsaEncrypt

func (ks *RsaKey) RsaEncrypt(origData []byte) ([]byte, error)

type RsaPublicKey

type RsaPublicKey struct {
	// Rsa public key
	RsaPublicKey *rsa.PublicKey

	// Rsa public key
	RsaPublicKeyBytes []byte
}

func NewRsaPublicKey

func NewRsaPublicKey(bs []byte) (*RsaPublicKey, error)

func (*RsaPublicKey) RsaEncrypt

func (ks *RsaPublicKey) RsaEncrypt(origData []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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