p2pcrypto

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeyPair

func GenerateKeyPair() (PrivateKey, PublicKey, error)

func PrependPubkey

func PrependPubkey(message []byte, pubkey PublicKey) []byte

Types

type Key

type Key interface {
	Bytes() []byte

	Array() [32]byte
	String() string
	// contains filtered or unexported methods
}

type PrivateKey

type PrivateKey interface {
	Key
}

func NewPrivateKeyFromBase58

func NewPrivateKeyFromBase58(s string) (PrivateKey, error)

type PublicKey

type PublicKey interface {
	Key
}

func ExtractPubkey

func ExtractPubkey(message []byte) ([]byte, PublicKey, error)

func NewPubkeyFromBytes

func NewPubkeyFromBytes(bytes []byte) (PublicKey, error)

func NewPublicKeyFromBase58

func NewPublicKeyFromBase58(s string) (PublicKey, error)

func NewRandomPubkey

func NewRandomPubkey() PublicKey

func PublicKeyFromArray

func PublicKeyFromArray(ke [32]byte) PublicKey

type SharedSecret

type SharedSecret interface {
	Key
	Seal(message []byte) (out []byte)
	Open(encryptedMessage []byte) (out []byte, err error)
}

func GenerateSharedSecret

func GenerateSharedSecret(privkey PrivateKey, peerPubkey PublicKey) SharedSecret

Jump to

Keyboard shortcuts

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