security

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientTLSConfig

func ClientTLSConfig(certPEM, keyPEM []byte, expectedFingerprint string) (*tls.Config, error)

func FingerprintCert

func FingerprintCert(cert *x509.Certificate) string

func FingerprintDER

func FingerprintDER(der []byte) string

func FingerprintPEM

func FingerprintPEM(certPEM []byte) (string, error)

func GenerateCSRFromKey

func GenerateCSRFromKey(keyPEM []byte, label string) ([]byte, error)

func GenerateClientIdentity

func GenerateClientIdentity(label string) (certPEM, keyPEM, csrPEM []byte, err error)

func HostIdentityFingerprint

func HostIdentityFingerprint(caCertPEM []byte) (string, error)

func ServerTLSConfig

func ServerTLSConfig(pki HostPKI) (*tls.Config, string, error)

func ShortFingerprint

func ShortFingerprint(fp string) string

func SignClientCSR

func SignClientCSR(caCertPEM, caKeyPEM, csrPEM []byte, label string) ([]byte, string, error)

Types

type HostPKI

type HostPKI struct {
	CACertPEM     []byte
	CAKeyPEM      []byte
	ServerCertPEM []byte
	ServerKeyPEM  []byte
}

func EnsureHostPKI

func EnsureHostPKI(stateDir, serverName string) (HostPKI, error)

Jump to

Keyboard shortcuts

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