token

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: BSD-2-Clause Imports: 8 Imported by: 1

Documentation

Overview

package token validates a sigsum submit-token.

Index

Constants

View Source
const (
	Label = "_sigsum_v1"

	HeaderName = "Sigsum-Token"
)

Variables

This section is empty.

Functions

func LookupDomain added in v0.4.1

func LookupDomain(ctx context.Context,
	lookupTXT func(context.Context, string) ([]string, error),
	domain string) ([]string, error)

Looks up the appropriate TXT records for a domain.

func MakeToken added in v0.1.7

func MakeToken(signer crypto.Signer, logKey *crypto.PublicKey) (crypto.Signature, error)

func NormalizeDomainName added in v0.1.18

func NormalizeDomainName(domain string) (string, error)

Normalizes a utf8 domain name.

func VerifyToken added in v0.1.15

func VerifyToken(key *crypto.PublicKey, logKey *crypto.PublicKey, token *crypto.Signature) error

Verify a token using a given key, with no DNS loookup.

Types

type DnsVerifier

type DnsVerifier struct {
	// contains filtered or unexported fields
}

DnsResolver implements the Verifier interface by querying DNS.

func NewDnsVerifier

func NewDnsVerifier(logKey *crypto.PublicKey) *DnsVerifier

func (*DnsVerifier) Verify

func (dv *DnsVerifier) Verify(ctx context.Context, header *SubmitHeader) error

type SubmitHeader added in v0.3.3

type SubmitHeader struct {
	Domain string
	Token  crypto.Signature
}

Represents the contents of the HTTP Sigsum-Submit: header-

func (*SubmitHeader) FromHeader added in v0.3.3

func (s *SubmitHeader) FromHeader(header string) error

func (*SubmitHeader) ToHeader added in v0.3.3

func (s *SubmitHeader) ToHeader() string

Jump to

Keyboard shortcuts

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