dns

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

package dns checks if a domain name is aware of a hashed public key. A look-up is performed if the specified domain name matches "^_sigsum_v0.*".

Example
name := "_sigsum_v0.testonly.sigsum.org"
pub := mustDecodePublicKey("cda2517e17dcba133eb0e71bf77473f94a77d7e61b1de4e1e64adfd0938d6182")

timeout := 10 * time.Second
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()

dr := NewDefaultResolver()
if err := dr.Verify(ctx, name, pub); err != nil {
	log.Fatal(err.Error())
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultResolver

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

DefaultResolver implements the Verifier interface with Go's default resolver

func (*DefaultResolver) Verify

func (dr *DefaultResolver) Verify(ctx context.Context, name string, pub *types.PublicKey) error

type Verifier

type Verifier interface {
	Verify(ctx context.Context, name string, key *types.PublicKey) error
}

Verifier can verify that a domain name is aware of a public key

func NewDefaultResolver

func NewDefaultResolver() Verifier

Jump to

Keyboard shortcuts

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