keypair

package
v1.19.2-beta0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypePemPublic  = "PUBLIC KEY"
	TypePemPrivate = "PRIVATE KEY"
)

Variables

This section is empty.

Functions

func DecodePemBlock

func DecodePemBlock(content []byte, targetType string) (*pem.Block, error)

func PemEncodePrivate

func PemEncodePrivate(content []byte) []byte

func PemEncodePublic

func PemEncodePublic(content []byte) []byte

func PemMarshalPrivate

func PemMarshalPrivate(key crypto.PrivateKey) ([]byte, error)

func PemMarshalPublic

func PemMarshalPublic(key crypto.PublicKey) ([]byte, error)

func PemUnmarshalPrivate

func PemUnmarshalPrivate[T crypto.PrivateKey](content []byte) (key T, err error)

func PemUnmarshalPublic

func PemUnmarshalPublic[T crypto.PublicKey](content []byte) (key T, err error)

func SshMarshalPrivate

func SshMarshalPrivate(key crypto.PrivateKey, comment string) ([]byte, error)

func SshMarshalPublic

func SshMarshalPublic(key crypto.PublicKey) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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