Documentation
¶
Index ¶
- Constants
- Variables
- type Cert
- type CertBundle
- type CertKey
- type CertList
- type CertListRequest
- type CertMeta
- type CertName
- type CertWithPrivateKey
- type CreateCertRequest
- type PrivateCertKey
- type PrivateCertName
- type RenewCertRequest
- type Subject
- type SubjectID
- type SubjectList
- type SubjectListRequest
- type SubjectMeta
- type SubjectRef
Constants ¶
View Source
const ( SchemaName = "cert" RootCertName = "$root$" )
View Source
const ( // DefaultCACertExpiry is the default validity period for intermediate // certificate authorities. DefaultCACertExpiry = 5 * 365 * 24 * time.Hour // DefaultCertExpiry is the default validity period for leaf certificates. DefaultCertExpiry = 90 * 24 * time.Hour )
View Source
const ( // Maximum number of subjects to return in a list query SubjectListLimit = 100 // Maximum number of certificates to return in a list query CertListLimit = 100 )
Variables ¶
View Source
var Objects string
View Source
var Queries string
Functions ¶
This section is empty.
Types ¶
type Cert ¶
type Cert struct {
ID uint64 `json:"-" readonly:""`
CertKey
Signer *CertKey `json:"signer,omitempty" jsonschema:"certificate authority that signed this certificate"`
Subject *SubjectRef `json:"subject,omitempty" readonly:"" jsonschema:"certificate subject details"`
SubjectID *uint64 `json:"-"`
SAN []string `` /* 172-byte string literal not displayed */
NotBefore time.Time `json:"not_before,omitzero" jsonschema:"start of certificate validity period" example:"2026-01-01T00:00:00Z"`
NotAfter time.Time `json:"not_after,omitzero" jsonschema:"end of certificate validity period" example:"2027-01-01T00:00:00Z"`
IsCA bool `json:"is_ca,omitempty" jsonschema:"whether this is a certificate authority" example:"false"`
CertMeta
Cert []byte `json:"cert,omitempty" jsonschema:"DER-encoded certificate data"`
EffectiveTags []string `` /* 129-byte string literal not displayed */
Ts time.Time `json:"timestamp,omitzero" jsonschema:"last modification timestamp"`
}
Certificate
type CertBundle ¶
type CertBundle struct {
Cert
Chain []Cert `json:"chain,omitempty" readonly:""`
Key []byte `json:"key,omitempty" readonly:""`
}
func (CertBundle) String ¶
func (c CertBundle) String() string
type CertKey ¶
type CertKey struct {
Name string `json:"name" example:"my_cert"`
Serial string `json:"serial" example:"123456789"`
}
Certificate key
type CertList ¶
type CertList struct {
CertListRequest
Count uint64 `json:"count"`
Body []Cert `json:"body,omitempty"`
}
type CertListRequest ¶
type CertListRequest struct {
pg.OffsetLimit
IsCA *bool `json:"is_ca,omitempty" jsonschema:"filter by certificate authority status" example:"true"`
Enabled *bool `json:"enabled,omitempty" negatable:"" jsonschema:"filter by effective enabled state" example:"true"`
Tags []string `json:"tags,omitempty" jsonschema:"require all specified effective tags" example:"[\"production\"]"`
Valid *bool `json:"valid,omitempty" jsonschema:"filter by current validity window" example:"true"`
Subject *uint64 `json:"subject,omitempty" jsonschema:"filter by subject row identifier" example:"1"`
}
func (CertListRequest) String ¶
func (c CertListRequest) String() string
type CertMeta ¶
type CertMeta struct {
Enabled *bool `json:"enabled,omitempty" negatable:""`
Tags []string `json:"tags,omitempty"`
}
Certificate Metadata
type CertWithPrivateKey ¶
type CertWithPrivateKey struct {
Cert
PV uint64 `json:"pv,omitempty" readonly:"" jsonschema:"private key version"`
Key []byte `json:"key,omitempty" jsonschema:"DER-encoded private key data"`
}
Composite of Cert and private key for select
func (CertWithPrivateKey) Insert ¶
func (c CertWithPrivateKey) Insert(bind *pg.Bind) (string, error)
func (CertWithPrivateKey) String ¶
func (c CertWithPrivateKey) String() string
type CreateCertRequest ¶
type CreateCertRequest struct {
Name string `json:"name,omitempty" jsonschema:"unique certificate name" example:"my_cert"`
Expiry time.Duration `json:"expiry,omitempty" jsonschema:"certificate validity duration" example:"8760h"`
Subject *SubjectMeta `json:"subject,omitempty" optional:"" jsonschema:"certificate subject details"`
SAN []string `` /* 172-byte string literal not displayed */
Tags []string `json:"tags,omitempty" jsonschema:"labels for grouping and filtering certificates" example:"[\"tag1\",\"tag2\"]"`
}
func (CreateCertRequest) String ¶
func (c CreateCertRequest) String() string
type PrivateCertKey ¶
Key for retrieving private certificate
type RenewCertRequest ¶
type RenewCertRequest struct {
Expiry time.Duration `json:"expiry,omitempty" jsonschema:"new certificate validity duration" example:"8760h"`
Subject *SubjectMeta `json:"subject,omitempty" jsonschema:"updated certificate subject details"`
}
func (RenewCertRequest) String ¶
func (c RenewCertRequest) String() string
type Subject ¶
type Subject struct {
ID uint64 `json:"id"`
SubjectMeta
Ts time.Time `json:"timestamp,omitzero"`
Subject *string `json:"subject,omitempty"`
}
type SubjectList ¶
type SubjectList struct {
SubjectListRequest
Count uint64 `json:"count"`
Body []Subject `json:"body,omitempty"`
}
func (SubjectList) String ¶
func (n SubjectList) String() string
type SubjectListRequest ¶
type SubjectListRequest struct {
pg.OffsetLimit
}
func (SubjectListRequest) String ¶
func (n SubjectListRequest) String() string
type SubjectMeta ¶
type SubjectMeta struct {
Org *string `json:"organizationName,omitempty" example:"Example Corp"`
Unit *string `json:"organizationalUnit,omitempty" example:"IT Department"`
Country *string `json:"countryName,omitempty" example:"US"`
City *string `json:"localityName,omitempty" example:"San Francisco"`
State *string `json:"stateOrProvinceName,omitempty" example:"California"`
StreetAddress *string `json:"streetAddress,omitempty" example:"123 Main St"`
PostalCode *string `json:"postalCode,omitempty" example:"94105"`
}
func MergeSubjectMeta ¶
func MergeSubjectMeta(base SubjectMeta, patch *SubjectMeta) SubjectMeta
func SubjectMetaFromPKIXName ¶
func SubjectMetaFromPKIXName(subject pkix.Name) SubjectMeta
func (SubjectMeta) String ¶
func (n SubjectMeta) String() string
type SubjectRef ¶
type SubjectRef struct {
ID uint64 `json:"-"`
SubjectMeta
Ts time.Time `json:"timestamp,omitzero"`
CommonName *string `json:"commonName,omitempty"`
Name *string `json:"name,omitempty"`
}
func SubjectRefFromMeta ¶
func SubjectRefFromMeta(id uint64, meta SubjectMeta, ts time.Time, commonName *string) SubjectRef
func (SubjectRef) String ¶
func (n SubjectRef) String() string
Click to show internal directories.
Click to hide internal directories.