package pem

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

Package pem contains functions for marshaling and unmarshaling keys in PEM format.

Index

Functions

func FromProto

func FromProto(_ context.Context, pb proto.Message) (crypto.Signer, error)

FromProto builds a crypto.Signer from a proto.Message, which must be of type PEMKeyFile.

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 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.

Source Files

pem.go

Version
v1.7.1 (latest)
Published
Jan 9, 2025
Platform
linux/amd64
Imports
10 packages
Last checked
5 days ago

Tools for package owners.