crypto

package
v2.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: Apache-2.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Curve = elliptic.P256

Functions

This section is empty.

Types

type Key

type Key struct {
	// contains filtered or unexported fields
}

func CreateKeyPair

func CreateKeyPair() (*Key, error)

func NewFromStrings

func NewFromStrings(pub, priv string) (*Key, error)

func (*Key) Decrypt

func (k *Key) Decrypt(in []byte) (out []byte, err error)

Decrypt authentications and recovers the original message from its input using the private key and the ephemeral key included in the message.

func (*Key) Encrypt

func (k *Key) Encrypt(in []byte) (out []byte, err error)

Encrypt secures and authenticates its input using the public key using ECDHE with AES-128-CBC-HMAC-SHA1.

func (*Key) GetPrivString

func (k *Key) GetPrivString() string

func (*Key) GetPubString

func (k *Key) GetPubString() string

func (*Key) SetPrivString

func (k *Key) SetPrivString(priv string) error

func (*Key) SetPubString

func (k *Key) SetPubString(pub string) error

func (*Key) Sign

func (k *Key) Sign(hash []byte) (string, error)

func (*Key) Verify

func (k *Key) Verify(hash []byte, signature string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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