Documentation ¶
Index ¶
- type Client
- func (c *Client) EnablePKI(_ context.Context) error
- func (c *Client) GenerateCertificate(ctx context.Context, commonName string, altNames []string) (*x509.Certificate, crypto.PrivateKey, error)
- func (c *Client) GenerateRoot(ctx context.Context, commonName string) error
- func (c *Client) GetCACertificate(ctx context.Context) (*x509.Certificate, error)
- func (c *Client) GetCertPool(ctx context.Context) (*x509.CertPool, error)
- func (c *Client) Revoke(ctx context.Context, cert *x509.Certificate) error
- func (c *Client) SetCA(ctx context.Context, cert *x509.Certificate, privateKey crypto.PrivateKey) error
- func (c *Client) SetRole(ctx context.Context, name string, role *Role) error
- func (c *Client) Sign(ctx context.Context, csr *x509.CertificateRequest) (*x509.Certificate, error)
- type Role
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GenerateCertificate ¶
func (c *Client) GenerateCertificate(ctx context.Context, commonName string, altNames []string) (*x509.Certificate, crypto.PrivateKey, error)
func (*Client) GenerateRoot ¶
func (*Client) GetCACertificate ¶
func (*Client) GetCertPool ¶
func (*Client) SetCA ¶
func (c *Client) SetCA(ctx context.Context, cert *x509.Certificate, privateKey crypto.PrivateKey) error
func (*Client) Sign ¶
func (c *Client) Sign(ctx context.Context, csr *x509.CertificateRequest) (*x509.Certificate, error)
type Role ¶
type Role struct { AllowLocalhost bool `json:"allow_localhost,omitempty"` AllowedDomains []string `json:"allowed_domains,omitempty"` AllowDomainsTemplate bool `json:"allow_domains_template,omitempty"` AllowBareDomains bool `json:"allow_bare_domains,omitempty"` AllowSubDomains bool `json:"allow_sub_domains,omitempty"` AllowGlobDomains bool `json:"allow_glob_domains,omitempty"` AllowAnyName bool `json:"allow_any_name,omitempty"` EnforceHostnames bool `json:"enforce_hostnames"` AllowIPSans bool `json:"allow_ip_sans,omitempty"` AllowedURISANS string `json:"allowed_uri_sans,omitempty"` AllowedOtherSANS string `json:"allowed_other_sans,omitempty"` ServerFlag bool `json:"server_flag,omitempty"` ClientFlag bool `json:"client_flag,omitempty"` CodeSigningFlag bool `json:"code_signing_flag,omitempty"` EmailProtectionFlag bool `json:"email_protection_flag,omitempty"` KeyType string `json:"key_type,omitempty"` KeyBits int `json:"key_bits,omitempty"` KeyUsage []string `json:"key_usage,omitempty"` ExtKeyUsage []string `json:"ext_key_usage,omitempty"` ExtKeyUsageOIDs string `json:"ext_key_usage_oids,omitempty"` UseCSRCommonName bool `json:"use_csr_common_name,omitempty"` UseCSRSans bool `json:"use_csr_sans,omitempty"` OU string `json:"ou,omitempty"` Organization string `json:"organization,omitempty"` Country string `json:"country,omitempty"` Locality string `json:"locality,omitempty"` Province string `json:"province,omitempty"` StreetAddress string `json:"street_address,omitempty"` PostalCode string `json:"postal_code,omitempty"` SerialNumber string `json:"serial_number,omitempty"` GenerateLease bool `json:"generate_lease,omitempty"` NoStore bool `json:"no_store,omitempty"` RequireCN bool `json:"require_cn,omitempty"` PolicyIdentifiers []string `json:"policy_identifiers,omitempty"` BasisConstraintsValidForNonCA bool `json:"basis_constraints_valid_for_non_ca,omitempty"` NotBeforeDuration string `json:"not_before_duration,omitempty"` }
Click to show internal directories.
Click to hide internal directories.