testonly

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: Apache-2.0 Imports: 14 Imported by: 9

Documentation

Overview

Package testonly contains code and data that should only be used by tests. Production code MUST NOT depend on anything in this package. This will be enforced by tools where possible.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckKeyMatchesSpec

func CheckKeyMatchesSpec(key crypto.PrivateKey, spec *keyspb.Specification) error

CheckKeyMatchesSpec verifies that the key conforms to the specification. If it does not, an error is returned.

func MustMarshalPrivatePEMToDER

func MustMarshalPrivatePEMToDER(keyPEM, password string) []byte

MustMarshalPrivatePEMToDER decrypts a PEM-encoded private key and returns it in DER encoding. If an error occurs, it panics.

func MustMarshalPublicPEMToDER

func MustMarshalPublicPEMToDER(keyPEM string) []byte

MustMarshalPublicPEMToDER reads a PEM-encoded public key and returns it in DER encoding. If an error occurs, it panics.

func SignAndVerify

func SignAndVerify(signer crypto.Signer, pubKey crypto.PublicKey) error

SignAndVerify exercises a signer by using it to generate a signature, and then verifies that this signature is correct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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