Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCSRObject ¶
func GenerateCSRObject(config CSRConfig) (*capi.CertificateSigningRequest, error)
GenerateCSRObject generates a certificate signing request object and returns it.
func UnescapeIPV6Address ¶
UnescapeIPV6Address removes left and right brackets used to escape IPv6 addresses. Example [2605:2700:0:3::4713:93e3] will return 2605:2700:0:3::4713:93e3. If this escaping does not exist return the original address without additional validation.
Types ¶
type CSRConfig ¶
type CSRConfig struct { // CommonName is the common name to be provided in the Certificate CommonName string `json:"commonName"` // Orgname is the name of the organization for the Certificate OrgName string `json:"orgName"` // Alternate Name values required to create CertificateRequest DNSNames []string `json:"dnsNames"` IPAddresses []net.IP `json:"ipAddresses"` // AssetsDir is the directory location where certificates and // private keys will be saved AssetsDir string `json:"assetsDir"` }
CSRConfig contains the configuration values required to generate a Certificate Signing Request for the agent.
type CertAgent ¶
type CertAgent struct {
// contains filtered or unexported fields
}
CertAgent is the top level object that represents a certificate agent. All the fields it holds are configuration values required for generating a CSR, doing a POST request to the signer and writing the singed certificate obtained from the signer to disk.
func (*CertAgent) RequestCertificate ¶
RequestCertificate will create a certificate signing request for a node with the config given and send it to a signer via a POST request. If something goes wrong it returns an error but wait forever for server to respond to request. NOTE: This method does not return the approved CSR from the signer.
func (*CertAgent) WaitForCertificate ¶
func (c *CertAgent) WaitForCertificate() (req *capi.CertificateSigningRequest, err error)
WaitForCertificate waits for a certificate to be issued until timeout, or returns an error. It does a GET to the signer with the CSR name.