testutil

package
v0.1.1-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package testutil provides helper functions for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrivateKeyFromPEM

func PrivateKeyFromPEM(privPEM string, keyID uint32) *tinkpb.Keyset_Key

PrivateKeyFromPEM produces a Keyset_Key from privatePEM.

func PublicKeyFromPEM

func PublicKeyFromPEM(pubPEM string, keyID uint32) *tinkpb.Keyset_Key

PublicKeyFromPEM produces a Keyset_Key from pubPEM.

func SignKeysetsFromPEMs

func SignKeysetsFromPEMs(privPEMs ...string) []*tink.KeysetHandle

SignKeysetsFromPEMs produces a slice of keysets, each with one private key.

func VerifyKeysetFromPEMs

func VerifyKeysetFromPEMs(pubPEMs ...string) *tink.KeysetHandle

VerifyKeysetFromPEMs produces a Keyset with pubPEMs.

Types

type FakeKT

type FakeKT struct {
	Server pb.KeyTransparencyServer
	Client pb.KeyTransparencyClient
	Addr   string
}

FakeKT runs a fake KeyTransparency server.

func NewFakeKT

func NewFakeKT(ktServer pb.KeyTransparencyServer) (*FakeKT, func(), error)

NewFakeKT returns a new fake Key Transparency server listening on a random port. Returns the started server and a close function.

Jump to

Keyboard shortcuts

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