token

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: BSD-2-Clause Imports: 7 Imported by: 1

Documentation

Overview

package token validates a sigsum submit-token.

Index

Constants

View Source
const (
	Label      = "_sigsum_v0"
	HeaderName = "Sigsum-Token"
)

Variables

This section is empty.

Functions

func MakeToken added in v0.1.7

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

TODO: Return hex string, for consistency with VerifyToken ?

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 string) 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 (*DnsVerifier) Verify

func (dv *DnsVerifier) Verify(ctx context.Context, name, signatureHex string) error

type Verifier

type Verifier interface {
	Verify(ctx context.Context, name, signature string) error
}

Verifier can verify that a domain name is aware of a public key. Name and signature corresponds to the value of the submit-token: header, so signature is still hex-encoded.

func NewDnsVerifier

func NewDnsVerifier(logKey *crypto.PublicKey) Verifier

Jump to

Keyboard shortcuts

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