package pem

import "github.com/google/trillian/crypto/keys/pem"

Index

Functions

func FromProto

func FromProto(pb *keyspb.PEMKeyFile) (crypto.Signer, error)

FromProto takes a PEMKeyFile protobuf message and loads the private key it specifies.

func ReadPrivateKeyFile

func ReadPrivateKeyFile(file, password string) (crypto.Signer, error)

ReadPrivateKeyFile reads a PEM-encoded private key from a file. The key must be protected by a password.

func ReadPublicKeyFile

func ReadPublicKeyFile(file string) (crypto.PublicKey, error)

ReadPublicKeyFile reads a PEM-encoded public key from a file.

func UnmarshalPrivateKey

func UnmarshalPrivateKey(keyPEM, password string) (crypto.Signer, error)

UnmarshalPrivateKey reads a PEM-encoded private key from a string. The key may be protected by a password.

func UnmarshalPublicKey

func UnmarshalPublicKey(keyPEM string) (crypto.PublicKey, error)

UnmarshalPublicKey reads a PEM-encoded public key from a string.

Source Files

pem.go

Directories

PathSynopsis
crypto/keys/pem/protoPackage proto registers a PEM keys.ProtoHandler using keys.RegisterHandler.
Version
v1.3.6
Published
Jan 9, 2020
Platform
js/wasm
Imports
8 packages
Last checked
1 hour ago

Tools for package owners.