package testonly
import "github.com/google/trillian/crypto/keys/testonly"
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 ¶
- func CheckKeyMatchesSpec(key crypto.PrivateKey, spec *keyspb.Specification) error
- func MustMarshalPrivatePEMToDER(keyPEM, password string) []byte
- func MustMarshalPublicPEMToDER(keyPEM string) []byte
- func SignAndVerify(signer crypto.Signer, pubKey crypto.PublicKey) error
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 ¶
MustMarshalPrivatePEMToDER decrypts a PEM-encoded private key and returns it in DER encoding. If an error occurs, it panics.
func MustMarshalPublicPEMToDER ¶
MustMarshalPublicPEMToDER reads a PEM-encoded public key and returns it in DER encoding. If an error occurs, it panics.
func SignAndVerify ¶
SignAndVerify exercises a signer by using it to generate a signature, and then verifies that this signature is correct.
Source Files ¶
- Version
- v1.0.5
- Published
- Jan 23, 2018
- Platform
- js/wasm
- Imports
- 14 packages
- Last checked
- 4 hours ago –
Tools for package owners.