authority

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authority

type Authority struct {
	// contains filtered or unexported fields
}

Authority manages the manifest state of Contrast.

func New

func New(reg *prometheus.Registry, log *slog.Logger) *Authority

New creates a new Authority instance.

func (*Authority) GetCertBundle

func (m *Authority) GetCertBundle(peerPublicKeyHashStr string) (Bundle, error)

GetCertBundle retrieves the certificate bundle created for the peer identified by the given public key.

func (*Authority) GetManifestsAndLatestCA

func (m *Authority) GetManifestsAndLatestCA() ([]*manifest.Manifest, *ca.CA)

GetManifestsAndLatestCA retrieves the manifest history and the currently active CA instance.

func (*Authority) LatestManifest

func (m *Authority) LatestManifest() (*manifest.Manifest, error)

LatestManifest retrieves the active manifest.

func (*Authority) SNPValidateOpts

func (m *Authority) SNPValidateOpts(report *sevsnp.Report) (*validate.Options, error)

SNPValidateOpts returns SNP validation options from reference values.

It also ensures that the policy hash in the report's HOSTDATA is allowed by the current manifest.

func (*Authority) SetManifest

func (m *Authority) SetManifest(mnfst *manifest.Manifest) error

SetManifest updates the active manifest.

func (*Authority) ValidateCallback

func (m *Authority) ValidateCallback(_ context.Context, report *sevsnp.Report,
	_ asn1.ObjectIdentifier, _, _, peerPubKeyBytes []byte,
) error

ValidateCallback creates a certificate bundle for the verified client.

type Bundle

type Bundle struct {
	WorkloadCert   []byte
	MeshCA         []byte
	IntermediateCA []byte
	RootCA         []byte
}

Bundle is a set of PEM-encoded certificates for Contrast workloads.

Jump to

Keyboard shortcuts

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