Documentation ¶
Index ¶
- func DecodeCertPEM(encoded []byte) (*x509.Certificate, error)
- func DecodePrivateKeyPEM(encoded []byte) (*rsa.PrivateKey, error)
- func EncodeCertPEM(cert *x509.Certificate) []byte
- func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte
- func EncodePublicKeyPEM(key *rsa.PublicKey) ([]byte, error)
- func GenerateCertificateHash(encoded []byte) (string, error)
- func GetOrGenerateCACert(kp *api.KeyPair, user string) (api.KeyPair, error)
- func GetOrGenerateServiceAccountKeys(kp *api.KeyPair, user string) (api.KeyPair, error)
- func NewCertificateAuthority() (*x509.Certificate, *rsa.PrivateKey, error)
- func NewKubeconfig(clusterName, endpoint string, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*kapi.Config, error)
- func NewKubeconfigV2(clusterName, endpoint string, caCert *x509.Certificate, caKey *rsa.PrivateKey, ...) (*kapi.Config, error)
- func NewPrivateKey() (*rsa.PrivateKey, error)
- func NewSelfSignedCACert(key *rsa.PrivateKey) (*x509.Certificate, error)
- type AltNames
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeCertPEM ¶
func DecodeCertPEM(encoded []byte) (*x509.Certificate, error)
DecodeCertPEM attempts to return a decoded certificate or nil if the encoded input does not contain a certificate.
func DecodePrivateKeyPEM ¶
func DecodePrivateKeyPEM(encoded []byte) (*rsa.PrivateKey, error)
DecodePrivateKeyPEM attempts to return a decoded key or nil if the encoded input does not contain a private key.
func EncodeCertPEM ¶
func EncodeCertPEM(cert *x509.Certificate) []byte
EncodeCertPEM returns PEM-endcoded certificate data.
func EncodePrivateKeyPEM ¶
func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte
EncodePrivateKeyPEM returns PEM-encoded private key data.
func EncodePublicKeyPEM ¶
EncodePublicKeyPEM returns PEM-encoded public key data.
func GenerateCertificateHash ¶
GenerateCertificateHash returns the encoded sha256 hash for the certificate provided
func GetOrGenerateCACert ¶
func NewCertificateAuthority ¶
func NewCertificateAuthority() (*x509.Certificate, *rsa.PrivateKey, error)
NewCertificateAuthority creates new certificate and private key for the certificate authority
func NewKubeconfig ¶
func NewKubeconfig(clusterName, endpoint string, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*kapi.Config, error)
NewKubeconfig creates a new Kubeconfig where endpoint is the ELB endpoint.
func NewKubeconfigV2 ¶
func NewKubeconfigV2(clusterName, endpoint string, caCert *x509.Certificate, caKey *rsa.PrivateKey, cfg *Config) (*kapi.Config, error)
func NewPrivateKey ¶
func NewPrivateKey() (*rsa.PrivateKey, error)
NewPrivateKey creates an rSA private key
func NewSelfSignedCACert ¶
func NewSelfSignedCACert(key *rsa.PrivateKey) (*x509.Certificate, error)
NewSelfSignedCACert creates a CA certificate.
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 Config ¶
type Config struct { CommonName string Organization []string AltNames AltNames Usages []x509.ExtKeyUsage Duration time.Duration }
Config contains the basic fields required for creating a certificate
func (*Config) NewSignedCert ¶
func (cfg *Config) NewSignedCert(key *rsa.PrivateKey, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, error)
NewSignedCert creates a signed certificate using the given CA certificate and key