keyutil

package
v0.0.0-...-ad3dc6e Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustReadPrivateKeyFile

func MustReadPrivateKeyFile(pkFile string, override ...Format) crypto.PrivateKey

MustReadPrivateKeyFile decodes a PEM encoded private key file and parses into a crypto.PrivateKey or panics.

func MustReadPublicKeyFile

func MustReadPublicKeyFile(pubkeyFile string, override ...Format) crypto.PublicKey

MustReadPublicKeyFile reads a PEM encoded public key file or panics

func ReadPrivateKey

func ReadPrivateKey(encodedPrivateKey []byte, override ...Format) (crypto.PrivateKey, error)

func ReadPrivateKeyFile

func ReadPrivateKeyFile(pkFile string, override ...Format) (crypto.PrivateKey, error)

ReadPrivateKeyFile decodes a PEM encoded private key file and parses into a crypto.PrivateKey

func ReadPublicKey

func ReadPublicKey(encodedPubkey []byte, override ...Format) (crypto.PublicKey, error)

ReadPublicKey decodes a PEM encoded public key and parses into crypto.PublicKey

func ReadPublicKeyFile

func ReadPublicKeyFile(pubkeyFile string, override ...Format) (crypto.PublicKey, error)

ReadPublicKeyFile reads a PEM encdoded public key file and parses into crypto.PublicKey

Types

type Format

type Format string

Private or public key schema

const (
	// Hints for reading key
	PKCS1        Format = "pkcs1"
	PKCS8        Format = "pkcs8"
	PKCS8_RSAPSS Format = "pkcs8_rsapss" // Go doesn't support
	PKIX         Format = "pxix"
	ECC          Format = "ecc"
)

Jump to

Keyboard shortcuts

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