crypto

package
v0.0.0-...-f2abd9a Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCertPoolFromFile

func LoadCertPoolFromFile(certFile string) (*x509.CertPool, error)

Types

type Signable

type Signable interface {
	ContentsForSignature() ([]byte, error)
}

type Signature

type Signature struct {
	X509CertificatePEM string `json:"x509_certificate_pem"`
	Signature          string `json:"signature"`
}

type Signer

type Signer interface {
	Sign(Signable) (*Signature, error)
}

func SignerFromFile

func SignerFromFile(certFilePath string, keyFilePath string) (Signer, error)

type Verifier

type Verifier interface {
	// Verify verifies a given Signature applies to a given Signable, the string argument is the required subject name
	// prefix . The suffix is always checked and has to be .metal.local.
	// for example, if the required prefix is "admin-" the subject must be something like admin-1.metal.local
	Verify(*Signature, Signable, string) error
}

func PKIVerifierFromFile

func PKIVerifierFromFile(rootCAPath string) (Verifier, error)

Jump to

Keyboard shortcuts

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