Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) CreatePKIRole(path string, opts CreatePKIRoleOptions) error
- func (c *Client) EnablePKIEngine(path string) error
- func (c *Client) GenerateIntermediateCA(path string, commonName string) (*x509.CertificateRequest, error)
- func (c *Client) GenerateRootCA(path string, commonName string) (*x509.Certificate, error)
- func (c *Client) SetSignedCertificate(path string, cert interface{}) error
- func (c *Client) SignIntermediateCA(path string, csr *x509.CertificateRequest) (interface{}, error)
- type CreatePKIRoleOptions
- type Option
Constants ¶
const ( CsrPemBlockType = "CERTIFICATE REQUEST" CertificatePemBlockType = "CERTIFICATE" PrivateKeyPemBlockType = "PRIVATE KEY" )
const ( DefaultLeaseTTL = "24h" DefaultMaxLeaseTTL = "87600h" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is the vault client that knows how to talk to the
func (*Client) CreatePKIRole ¶
func (c *Client) CreatePKIRole(path string, opts CreatePKIRoleOptions) error
CreatePKIRole creates a PKI role with the given options at the given path.
func (*Client) EnablePKIEngine ¶
EnablePKIEngine enables the PKI engine at the given path.
func (*Client) GenerateIntermediateCA ¶
func (c *Client) GenerateIntermediateCA(path string, commonName string) (*x509.CertificateRequest, error)
GenerateIntermediateCA generates an intermediate CA in the PKI secrets engine at the given path and then returns it.
func (*Client) GenerateRootCA ¶
GenerateRootCA generates a root CA in the PKI secrets engine at the given path and then returns it.
func (*Client) SetSignedCertificate ¶
SetSignedCertificate sets the signed certificate into the intermediate PKI secrets engine at the given path.
func (*Client) SignIntermediateCA ¶
func (c *Client) SignIntermediateCA(path string, csr *x509.CertificateRequest) (interface{}, error)
SignIntermediateCA signs the CSR and imports it into the given root PKI secrets engine.
type CreatePKIRoleOptions ¶
type CreatePKIRoleOptions struct { RoleName string AllowedDomains []string AllowSubdomains bool AllowBareDomains bool AllowGlobDomains bool MaxTTL string }
CreatePKIRoleOptions is the data structure that holds the configuration required to create a PKI Role.
type Option ¶
func WithAddress ¶
WithAddress sets the given address on the client.
func WithConfig ¶
WithConfig instantiates a vault client with the given config.