tls

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cert

type Cert struct {
	CertRawData      `label:"Certificate Raw Info"`
	CertComputedData `label:"Certificate Computed Info"`
}

type CertComputedData

type CertComputedData struct {
	Expired             bool          `label:"Expired"`
	TimeUntilExpiry     time.Duration `label:"Time Until Expiry"`
	TotalValidity       time.Duration `label:"Total Validity Duration"`
	TimeSinceIssued     time.Duration `label:"Time Since Issued"`
	ValidityUsedPercent float64       `label:"Validity Used (%)"`
	RemainingPercent    float64       `label:"Time Remaining (%)"`
	ExpiryStatus        ExpiryStatus  `label:"Expiry ExpiryStatus"`
	IsSelfSigned        bool          `label:"Self-Signed"`
	IsCurrentlyValid    bool          `label:"Currently Valid"`
}

type CertRawData

type CertRawData struct {
	// Raw Info
	Subject            string `label:"Subject"`
	Issuer             string `label:"Issuer"`
	SerialNumber       string `label:"Serial Number"`
	NotBefore          string `label:"Valid From"`
	NotAfter           string `label:"Valid To"`
	Signature          string `label:"Signature"`
	SignatureAlgorithm string `label:"Signature Algorithm"`
	PublicKeyAlgorithm string `label:"Public PemKey Algorithm"`
	IsCA               bool   `label:"Is CA"`

	// Subject Alternative Names
	DNSNames       []string `label:"DNS Names"`
	EmailAddresses []string `label:"Email Addresses"`
	IPAddresses    []string `label:"IP Addresses"`
	URIs           []string `label:"URIs"`

	// PemKey IDs
	SubjectKeyID   string `label:"Subject PemKey ID"`
	AuthorityKeyID string `label:"Authority PemKey ID"`

	// CRL / OCSP
	CRLDistributionPoints []string `label:"CRL Distribution Points"`
	OCSPServers           []string `label:"OCSP Servers"`

	// Usage
	KeyUsage     string   `label:"PemKey Usage"`
	ExtKeyUsages []string `label:"Extended PemKey Usage"`

	// Certificate Version
	Version int `label:"X.509 Version"`
}

type ExpiryStatus

type ExpiryStatus int
const (
	Valid ExpiryStatus = iota
	Warning
	Critical
	Expired
)

func (ExpiryStatus) String

func (s ExpiryStatus) String() string

type Repository

type Repository interface {
	GetTLSSecrets(namespace string) ([]Secret, error)
	GetTLSSecret(namespace, name string) (Secret, error)
}

type Secret

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

func NewTLS

func NewTLS(name string, namespace string, secretType string, pem []byte, key []byte, certs []Cert) Secret

func (Secret) Certs

func (t Secret) Certs() []Cert

func (Secret) Equals

func (t Secret) Equals(t2 Secret) bool

func (Secret) Name

func (t Secret) Name() string

func (Secret) Namespace

func (t Secret) Namespace() string

func (Secret) PemCert

func (t Secret) PemCert() string

func (Secret) PemKey

func (t Secret) PemKey() string

Jump to

Keyboard shortcuts

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