signature

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const BLS12381G1 = 0xd0ea
View Source
const BLS12381G2 = 0xd0eb
View Source
const EIP191 = 0xd191
View Source
const ES256 = 0xd01200
View Source
const ES256K = 0xd0e7
View Source
const ES384 = 0xd01201
View Source
const ES512 = 0xd01202
View Source
const EdDSA = 0xd0ed
View Source
const NON_STANDARD = 0xd000
View Source
const RS256 = 0xd01205

Variables

This section is empty.

Functions

func CodeName

func CodeName(code uint64) (string, error)

func Encode

func Encode(s Signature) []byte

func NameCode

func NameCode(name string) (uint64, error)

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 NewNonStandard

func NewNonStandard(name string, raw []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