Help us shape the future of Go! Take the 2026 Go Developer Survey

pem

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: Apache-2.0 Imports: 10 Imported by: 83

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

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 may be protected by a password. If password is empty, the key is assumed to be unencrypted.

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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