signature

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const EdDSA = 0xd0ed

Variables

This section is empty.

Functions

func Encode

func Encode(s Signature) []byte

Types

type Signature

type Signature interface {
	Code() uint64
	Size() uint64
	Bytes() []byte
	// Raw signature (without signature algorithm info).
	Raw() []byte
}

func Decode

func Decode(b []byte) Signature

func NewSignature

func NewSignature(code uint64, raw []byte) Signature

type SignatureView

type SignatureView interface {
	Signature
	// Verify that the signature was produced by the given message.
	Verify(msg []byte, signer Verifier) bool
}

func NewSignatureView

func NewSignatureView(s Signature) SignatureView

type Verifier

type Verifier interface {
	// Verify takes a byte encoded message and verifies that it is signed by
	// corresponding signer.
	Verify(msg []byte, sig Signature) bool
}

Verifier represents an entity that can verify signatures.

Jump to

Keyboard shortcuts

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