message

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: Apache-2.0 Imports: 4 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SecureMessage

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

SecureMessage provides a sequence-independent, stateless, contextless messaging system.

func New

func New(private *keys.PrivateKey, peerPublic *keys.PublicKey) *SecureMessage

New makes a new Secure Message context. You need to specify both keys for encrypt-decrypt mode. Private key is required for signing messages. Public key is required for verifying messages

func (*SecureMessage) Sign

func (sm *SecureMessage) Sign(message []byte) ([]byte, error)

Sign signs the provided message and returns it signed.

func (*SecureMessage) Unwrap

func (sm *SecureMessage) Unwrap(message []byte) ([]byte, error)

Unwrap decrypts the encrypted message.

func (*SecureMessage) Verify

func (sm *SecureMessage) Verify(message []byte) ([]byte, error)

Verify checks the signature on the message and returns the original message.

func (*SecureMessage) Wrap

func (sm *SecureMessage) Wrap(message []byte) ([]byte, error)

Wrap encrypts the provided message.

Jump to

Keyboard shortcuts

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