crypto

package
v0.0.0-...-27aaa03 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NACLKeyToURLBase64

func NACLKeyToURLBase64(key nacl.Key) string

func URLBase64ToNACLKey

func URLBase64ToNACLKey(s0 string) (nacl.Key, error)

Types

type Box

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

func NewBox

func NewBox(peerPub, priv nacl.Key) (*Box, error)

func (*Box) Open

func (b *Box) Open(ciphertext []byte, nonce nacl.Nonce) ([]byte, bool)

func (*Box) Seal

func (b *Box) Seal(msg []byte) []byte

type NodeKey

type NodeKey struct {
	Pub  nacl.Key
	Priv nacl.Key
}

func NewNodeKey

func NewNodeKey() (*NodeKey, error)

func (*NodeKey) MarshalJSON

func (k *NodeKey) MarshalJSON() (j []byte, err error)

func (*NodeKey) PubBytes

func (k *NodeKey) PubBytes() []byte

func (*NodeKey) UnmarshalJSON

func (k *NodeKey) UnmarshalJSON(j []byte) (err error)

Jump to

Keyboard shortcuts

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