keypair

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyPair

type KeyPair struct {
	Public  string `json:"public"`
	Private string `json:"private,omitempty"`
	// contains filtered or unexported fields
}

func Load

func Load(keypairString string) (kp KeyPair, err error)

Load will load from a string

func New

func New(kpLoad ...KeyPair) (kp KeyPair, err error)

New will generate a new key pair, or reload a keypair from a public key or a public-private key pair.

func (KeyPair) Decrypt

func (kp KeyPair) Decrypt(encrypted []byte, senderPublicKey string) (msg []byte, err error)

Decrypt a message

func (KeyPair) Encrypt

func (kp KeyPair) Encrypt(msg []byte, recipientPublicKey string) (encrypted []byte, err error)

Encrypt a message for a recipient

func (KeyPair) String

func (kp KeyPair) String() string

Jump to

Keyboard shortcuts

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