signing

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Signer

type Signer struct {
	PublicKey wgtypes.Key
	// contains filtered or unexported fields
}

Signer represents a helper that does signing and verification

func New

func New(privateKey *wgtypes.Key) *Signer

New creates a new Signer using the given private key

func (*Signer) SignFor

func (s *Signer) SignFor(
	data []byte,
	peer *wgtypes.Key,
) (
	nonce [chacha20poly1305.NonceSizeX]byte,
	tag [poly1305.TagSize]byte,
	err error,
)

SignFor makes a signature to send data to a given peer

func (*Signer) VerifyFrom

func (s *Signer) VerifyFrom(
	nonce [chacha20poly1305.NonceSizeX]byte,
	tag [poly1305.TagSize]byte,
	data []byte,
	peer *wgtypes.Key,
) (
	valid bool,
	err error,
)

VerifyFrom checks the signature on received data from a given peer

Jump to

Keyboard shortcuts

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