Documentation ¶
Index ¶
- Constants
- func CheckCaExistsFromSecret() bool
- func CheckCertExistsFromSecret() bool
- func CreateCaSecret(certDER, key []byte) error
- func CreateCloudCoreSecret(certDER, key []byte) error
- func CreateNamespaceIfNeeded(cli kubernetes.Interface, ns string) error
- func CreateSecret(secret *corev1.Secret, ns string) error
- func CreateTokenSecret(caHashAndToken []byte) error
- func EncodeCertPEM(cert *x509.Certificate) []byte
- func GenerateToken() error
- func GetSecret(secretName string, ns string) (*corev1.Secret, error)
- func NewCertFromCa(cfg *certutil.Config, caCert *x509.Certificate, serverKey crypto.PublicKey, ...) ([]byte, error)
- func NewCertificateAuthorityDer() ([]byte, crypto.Signer, error)
- func NewCloudCoreCertDERandKey(cfg *certutil.Config) ([]byte, []byte, error)
- func NewPrivateKey() (crypto.Signer, error)
- func NewSelfSignedCACertDERBytes(key crypto.Signer) ([]byte, error)
- func PrepareAllCerts() error
- func SignCerts() ([]byte, []byte, error)
- func StartHTTPServer()
- func UpdateConfig(ca, caKey, cert, key []byte)
Constants ¶
const ( NamespaceSystem string = "kubeedge" TokenSecretName string = "tokensecret" TokenDataName string = "tokendata" CaSecretName string = "casecret" CloudCoreSecretName string = "cloudcoresecret" CaDataName string = "cadata" CaKeyDataName string = "cakeydata" CloudCoreCertName string = "cloudcoredata" CloudCoreKeyDataName string = "cloudcorekeydata" )
Variables ¶
This section is empty.
Functions ¶
func CheckCaExistsFromSecret ¶
func CheckCaExistsFromSecret() bool
CheckCaExistsFromSecret checks ca from secret
func CheckCertExistsFromSecret ¶
func CheckCertExistsFromSecret() bool
CheckCertExistsFromSecret checks CloudCore certificate from secret
func CreateCaSecret ¶
func CreateCloudCoreSecret ¶
func CreateNamespaceIfNeeded ¶
func CreateNamespaceIfNeeded(cli kubernetes.Interface, ns string) error
func CreateSecret ¶
CreateSecret creates a secret
func CreateTokenSecret ¶
func EncodeCertPEM ¶
func EncodeCertPEM(cert *x509.Certificate) []byte
EncodeCertPEM returns PEM-endcoded certificate data
func GenerateToken ¶
func GenerateToken() error
GenerateToken will create a token consisting of caHash and jwt Token and save it to secret
func NewCertFromCa ¶
func NewCertFromCa(cfg *certutil.Config, caCert *x509.Certificate, serverKey crypto.PublicKey, caKey crypto.Signer, validalityPeriod time.Duration) ([]byte, error)
NewCertFromCa creates a signed certificate using the given CA certificate and key
func NewCertificateAuthorityDer ¶
NewCertificateAuthorityDer returns certDer and key
func NewCloudCoreCertDERandKey ¶
NewCloudCoreCertDERandKey creates certificate and key for CloudCore
func NewPrivateKey ¶
NewPrivateKey creates an ECDSA private key
func NewSelfSignedCACertDERBytes ¶
NewSelfSignedCACertDERBytes creates a CA certificate
func PrepareAllCerts ¶
func PrepareAllCerts() error
PrepareAllCerts check whether the certificates exist in the local directory, and then check whether certificates exist in the secret, generate if they don't exist
func UpdateConfig ¶
func UpdateConfig(ca, caKey, cert, key []byte)
Types ¶
This section is empty.