truststore

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 11 Imported by: 16

Documentation

Overview

Package truststore reads certificates in a trust store

Index

Constants

This section is empty.

Variables

View Source
var (
	Types = []Type{
		TypeCA,
		TypeSigningAuthority,
	}
)

Functions

func ValidateCertificates

func ValidateCertificates(certs []*x509.Certificate) error

ValidateCertificates ensures certificates from trust store are CA certificates or self-signed.

Types

type Type

type Type string

Type is an enum for trust store types supported such as "ca" and "signingAuthority"

const (
	TypeCA               Type = "ca"
	TypeSigningAuthority Type = "signingAuthority"
)

type X509TrustStore

type X509TrustStore interface {
	// GetCertificates returns certificates under storeType/namedStore
	GetCertificates(ctx context.Context, storeType Type, namedStore string) ([]*x509.Certificate, error)
}

X509TrustStore provide list and get behaviors for the trust store

func NewX509TrustStore

func NewX509TrustStore(trustStorefs dir.SysFS) X509TrustStore

NewX509TrustStore generates a new X509TrustStore

Jump to

Keyboard shortcuts

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