signing

package
v0.14.3 Latest Latest
Warning

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

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

Documentation

Overview

Package signing provides code for signing and verifying signatures using the XChaCha20-Poly1305-Curve25519 construction.

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 [chacha20poly1305.Overhead]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 [chacha20poly1305.Overhead]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