Documentation ¶
Index ¶
- func EncodeCertPEM(cert *x509.Certificate) []byte
- func GenerateBootstrapToken() (id string, secret string)
- func GenerateCertHash(data []byte) ([]byte, error)
- func GenerateCertHashFromFile(caCertPath string) ([]byte, error)
- func MustEncodePrivateKeyPem(key crypto.Signer) []byte
- func NewPrivateKey() (crypto.Signer, error)
- func NewSelfSignedCACert(cfg *Config, key crypto.Signer) (*x509.Certificate, error)
- func NewSignedCert(cfg *Config, key crypto.Signer, caCert *x509.Certificate, caKey crypto.Signer) (*x509.Certificate, error)
- func ReadCertFromFile(path string) (*x509.Certificate, error)
- func ReadKeyFromFile(path string) (crypto.Signer, error)
- func WriteCert(path, name string, cert *x509.Certificate) error
- func WriteCertAndKey(path, name string, cert *x509.Certificate, key crypto.Signer) error
- func WriteKey(path, name string, key crypto.Signer) error
- func WritePublicKey(path, name string, key crypto.PublicKey) error
- type AltNames
- type CertificateAuthority
- type Config
- type KeyPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeCertPEM ¶
func EncodeCertPEM(cert *x509.Certificate) []byte
EncodeCertPEM returns PEM-endcoded certificate data
func GenerateBootstrapToken ¶
GenerateBootstrapToken constructs a bootstrap token in conformance with the following format: https://kubernetes.io/docs/admin/bootstrap-tokens/#token-format
func GenerateCertHash ¶
func MustEncodePrivateKeyPem ¶
func NewPrivateKey ¶
func NewSelfSignedCACert ¶
NewSelfSignedCACert creates a CA certificate
func NewSignedCert ¶
func NewSignedCert(cfg *Config, key crypto.Signer, caCert *x509.Certificate, caKey crypto.Signer) (*x509.Certificate, error)
NewSignedCert creates a signed certificate using the given CA certificate and key
func ReadCertFromFile ¶
func ReadCertFromFile(path string) (*x509.Certificate, error)
func WriteCertAndKey ¶
Types ¶
type AltNames ¶
AltNames contains the domain names and IP addresses that will be added to the API Server's x509 certificate SubAltNames field. The values will be passed directly to the x509.Certificate object.
type CertificateAuthority ¶
type CertificateAuthority struct {
*KeyPair
}
func LoadCertificateAuthority ¶
func LoadCertificateAuthority(path, name string) (*CertificateAuthority, error)
func NewCertificateAuthority ¶
func NewCertificateAuthority(name string, cfg *Config) (*CertificateAuthority, error)
func (*CertificateAuthority) NewSignedKeyPair ¶
func (c *CertificateAuthority) NewSignedKeyPair(name string, cfg *Config) (*KeyPair, error)
NewSignedKeyPair returns a new KeyPair signed by the CA.
Click to show internal directories.
Click to hide internal directories.