vault

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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 NewClient

func NewClient(addr, token, role string) (*Client, error)

func (*Client) EnablePKI

func (c *Client) EnablePKI(_ context.Context) error

func (*Client) GenerateCertificate

func (c *Client) GenerateCertificate(ctx context.Context, commonName string, altNames []string) (*x509.Certificate, crypto.PrivateKey, error)

func (*Client) GenerateRoot

func (c *Client) GenerateRoot(ctx context.Context, commonName string) error

func (*Client) GetCACertificate

func (c *Client) GetCACertificate(ctx context.Context) (*x509.Certificate, error)

func (*Client) GetCertPool

func (c *Client) GetCertPool(ctx context.Context) (*x509.CertPool, error)

func (*Client) Revoke

func (c *Client) Revoke(ctx context.Context, cert *x509.Certificate) error

func (*Client) SetCA

func (c *Client) SetCA(ctx context.Context, cert *x509.Certificate, privateKey crypto.PrivateKey) error

func (*Client) SetRole

func (c *Client) SetRole(ctx context.Context, name string, role *Role) error

func (*Client) Sign

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"`
}

Jump to

Keyboard shortcuts

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