schema

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsOcspResponses = config.MetricsTablePrefix + "ocsp_responses"
	MetricsUpperCaInfo   = config.MetricsTablePrefix + "upper_ca_info"
	MetricsOverall       = config.MetricsTablePrefix + "ca_overall"
	MetricsCaSign        = config.MetricsTablePrefix + "ca_sign"
	MetricsCaRevoke      = config.MetricsTablePrefix + "ca_revoke"
	MetricsCaCpuMem      = config.MetricsTablePrefix + "cpu_mem"

	MetricsUpperCaTypeInfo = "ca_info"

	MetricsLabelIp = "ip"
)

Variables

This section is empty.

Functions

func GetHostFromUrl

func GetHostFromUrl(addr string) string

func GetLocalIpLabel

func GetLocalIpLabel() string

Types

type CaMetadata

type CaMetadata struct {
	O        string              `mapstructure:"o,omitempty" json:"o"`
	OU       string              `mapstructure:"ou,omitempty" json:"ou"`
	SpiffeId *spiffe.IDGIdentity `mapstructure:"spiffe_id" json:"spiffe_id,omitempty"`
}

func GetCaMetadataFromX509Cert

func GetCaMetadataFromX509Cert(cert *x509.Certificate) CaMetadata

type Certificate

type Certificate struct {
	Subject            certinfo.Name `mapstructure:"subject,omitempty" json:"subject,omitempty" swaggertype:"object"`
	Issuer             certinfo.Name `mapstructure:"issuer,omitempty" json:"issuer,omitempty" swaggertype:"object"`
	SerialNumber       string        `mapstructure:"serial_number,omitempty" json:"serial_number,omitempty"`
	SANs               []string      `mapstructure:"sans,omitempty" json:"sans,omitempty"`
	NotBefore          time.Time     `mapstructure:"not_before,omitempty" json:"not_before"`
	NotAfter           time.Time     `mapstructure:"not_after,omitempty" json:"not_after"`
	SignatureAlgorithm string        `mapstructure:"sigalg,omitempty" json:"sigalg"`
	AKI                string        `mapstructure:"authority_key_id,omitempty" json:"authority_key_id"`
	SKI                string        `mapstructure:"subject_key_id,omitempty" json:"subject_key_id"`
	RawPEM             string        `mapstructure:"-" json:"-"`
}

Certificate represents a JSON description of an X.509 certificate.

func ParseCertificate

func ParseCertificate(cert *x509.Certificate) *Certificate

ParseCertificate parses an x509 certificate.

type FullCert

type FullCert struct {
	SampleCert
	CertStr  string            `mapstructure:"cert_str,omitempty" json:"cert_str"` // Show certificate details
	CertInfo *Certificate      `mapstructure:"cert_info,omitempty" json:"cert_info,omitempty"`
	RawCert  *x509.Certificate `mapstructure:"-" json:"-"`
}

Certificate details cert

func GetFullCertByModelCert

func GetFullCertByModelCert(row *model.Certificates) (*FullCert, error)

func GetFullCertByX509Cert

func GetFullCertByX509Cert(cert *x509.Certificate) *FullCert

type SampleCert

type SampleCert struct {
	SN        string    `mapstructure:"sn,omitempty" json:"sn"`
	AKI       string    `mapstructure:"aki,omitempty" json:"aki"`
	CN        string    `mapstructure:"cn,omitempty" json:"cn"`
	O         string    `mapstructure:"o,omitempty" json:"o"`
	OU        string    `mapstructure:"ou,omitempty" json:"ou"`
	Role      string    `mapstructure:"role,omitempty" json:"role,omitempty"`
	UniqueId  string    `mapstructure:"unique_id,omitempty" json:"unique_id"`
	Status    string    `mapstructure:"status,omitempty" json:"status" example:"good"`
	IssuedAt  time.Time `mapstructure:"issued_at,omitempty" json:"issued_at,omitempty"`
	NotBefore time.Time `mapstructure:"not_before,omitempty" json:"not_before,omitempty"`
	Expiry    time.Time `mapstructure:"expiry,omitempty" json:"expiry,omitempty"`
	RevokedAt time.Time `mapstructure:"revoked_at,omitempty" json:"revoked_at,omitempty"`
}

SampleCert Certificate list cert

Jump to

Keyboard shortcuts

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