Documentation
¶
Overview ¶
General notes on this package:
- Needs all non-PKI specific stuff removed
- Needs command related logging removed
- Ideally this package can be extracted from this project and made more generic
Index ¶
- Variables
- func GenerateCACertificate(certFile, keyFile, org string, bits int) error
- func GenerateCertificate(hosts []string, certFile, keyFile, caFile, caKeyFile, org string, bits int) error
- type Config
- type Mirror
- 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
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.
Types ¶
type Mirror ¶
var MirrorConfig Mirror
func (*Mirror) SetClientTLSConfig ¶
func (*Mirror) SetServerTLSConfig ¶
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.