keylookup

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: BSD-3-Clause Imports: 9 Imported by: 4

Documentation

Overview

Package keylookup implements key lookup calls.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadSigner is returned if a verification pubkey list was signed by the wrong signer
	ErrBadSigner = errors.New("keylookup: bad signer")
	// ErrParams is returned if a call returned bad parameters
	ErrParams = errors.New("keylookup: bad RPC parameters")
	// ErrBadSignature signals that a packet signature did not verify
	ErrBadSignature = errors.New("keylookup: bad signature")
)
View Source
var DefaultClientFactory = jsonclient.New

DefaultClientFactory is the default factory for new clients

ServiceURL is the default URL for the keylookup service

Functions

This section is empty.

Types

type LookupClient

type LookupClient struct {
	KeyPool        *keypool.KeyPool
	ClientFactory  func(string, []byte) (*jsonclient.URLClient, error)
	ServiceGuardCA []byte // The CA of the serviceguard, if any
	PubKey         *[ed25519.PublicKeySize]byte
}

LookupClient implements a key lookup client

func New

func New(keyPool *keypool.KeyPool, cacert []byte, pubKey *[ed25519.PublicKeySize]byte) *LookupClient

New returns a new key lookup client

func (LookupClient) GetKey

func (klc LookupClient) GetKey(keyid *[signkeys.KeyIDSize]byte) (*signkeys.PublicKey, error)

GetKey tries to lookup a key from the lookup service

func (LookupClient) GetVerifyList

func (klc LookupClient) GetVerifyList() ([][ed25519.PublicKeySize]byte, error)

GetVerifyList requests a list of known issuer keys from the lookup service

func (*LookupClient) RegisterStorage

func (klc *LookupClient) RegisterStorage()

RegisterStorage adds the lookup client to the keypool storage to accomplish automatic fetches. This should be used with great care since it locks the keypool during fetch (which can be many minutes).

Jump to

Keyboard shortcuts

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