Documentation ¶
Index ¶
- Variables
- func GenerateCACertificate(certFile, keyFile, org string, bits int) error
- func GenerateCertificate(hosts []string, certFile, keyFile, caFile, caKeyFile, org string, bits int) error
- func GetCADir() string
- func GetCertDir() string
- func GetHomeDir() string
- func GetPkiDir() string
- func GetUsername() string
- func OutputFileContents(file string) (string, error)
- func Retryable(f func() error, timeout time.Duration) error
- type Config
- type PKI
- func (p *PKI) CheckSetup() error
- func (p *PKI) GenerateClientCertificate(hosts []string) (err error)
- func (p *PKI) GetClientTLSConfig() (*tls.Config, error)
- func (p *PKI) GetServerTLSConfig() (*tls.Config, error)
- func (p *PKI) ImportCA(name string, certPath string) error
- func (p *PKI) ImportClientCertAndKey(certPath string, keyPath string) error
- func (p *PKI) OutputCACert() (string, error)
- func (p *PKI) OutputCAKey() (string, error)
- func (p *PKI) OutputClientCert() (string, error)
- func (p *PKI) OutputClientKey() (string, error)
- func (p *PKI) RemovePKI() error
- func (p *PKI) SetupPKI(caHost string) error
- type Pki
Constants ¶
This section is empty.
Variables ¶
View Source
var CertificatePreamble = "-----BEGIN CERTIFICATE-----"
View Source
var KeyPreamble = "-----BEGIN RSA PRIVATE KEY-----"
Functions ¶
func GenerateCACertificate ¶
GenerateCACertificate generates a new certificate authority from the specified org and bit size and stores the resulting certificate and key file in the arguments.
func GenerateCertificate ¶
func GenerateCertificate(hosts []string, certFile, keyFile, caFile, caKeyFile, org string, bits int) error
GenerateCertificate generates a new certificate signed using the provided certificate authority files and stores the result in the certificate file and key provided. The provided host names are set to the appropriate certificate fields.
func GetCertDir ¶
func GetCertDir() string
func GetHomeDir ¶
func GetHomeDir() string
func GetUsername ¶
func GetUsername() string
func OutputFileContents ¶
Types ¶
type PKI ¶
type PKI struct {
Config *Config
}
func NewWithConfig ¶
func (*PKI) CheckSetup ¶
Validate all components of the PKI infrastructure are properly configured
func (*PKI) GenerateClientCertificate ¶
func (*PKI) ImportClientCertAndKey ¶
Overrides the default client certificate with a new one
func (*PKI) OutputCACert ¶
func (*PKI) OutputCAKey ¶
func (*PKI) OutputClientCert ¶
func (*PKI) OutputClientKey ¶
Click to show internal directories.
Click to hide internal directories.