nodetag

package
v1.118.5 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SignatureErr means that the signature wash wrong.
	SignatureErr = errs.Class("invalid signature")

	// SerializationErr is returned when the tags are signed, but the payload couldn't be unmarshalled.
	SerializationErr = errs.Class("invalid tag serialization")

	// WrongSignee is returned when the tags are signed, but the signee field has a different NodeID.
	WrongSignee = errs.Class("node id mismatch")
)
View Source
var (
	// UnknownSignee is returned when the public key is not available for NodeID to check the signature.
	UnknownSignee = errs.Class("node tag signee is unknown")
)

Functions

func Sign

func Sign(ctx context.Context, tagSet *pb.NodeTagSet, signer signing.Signer) (*pb.SignedNodeTagSet, error)

Sign create a signed tag set from a raw one.

func Verify

func Verify(ctx context.Context, tags *pb.SignedNodeTagSet, signee signing.Signee) (*pb.NodeTagSet, error)

Verify checks the signature of a signed tag set.

Types

type Authority

type Authority []signing.Signee

Authority contains all possible signee.

func (Authority) Verify

func (a Authority) Verify(ctx context.Context, tags *pb.SignedNodeTagSet) (*pb.NodeTagSet, error)

Verify checks if any of the storage signee can validate the signature.

Jump to

Keyboard shortcuts

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