utils

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLength = 2048
)
View Source
const PrivateKey = "privateKey"

Variables

This section is empty.

Functions

func BuildConfig

func BuildConfig(clusterName string, connect v1beta1.ConnectConfig, secretGetter SecretGetter) (*rest.Config, error)

BuildConfig return rest config for cluster.

func BuildSecret

func BuildSecret(key types.NamespacedName) (*v1.Secret, *rsa.PrivateKey, error)

func CertsToSecret

func CertsToSecret(key []byte, sec types.NamespacedName) *v1.Secret

func EncodePrivateKeyPEM

func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte

func GetConfigOrDie

func GetConfigOrDie(master, kubeConfig string) *rest.Config

func NewPrivateKey

func NewPrivateKey() (*rsa.PrivateKey, error)

func RSADecryptByPrivateKey

func RSADecryptByPrivateKey(cipherText []byte, key *rsa.PrivateKey) ([]byte, error)

RSADecryptByPrivateKey 解密

func RSAEncryptByPublicKey

func RSAEncryptByPublicKey(plainText []byte, key *rsa.PublicKey) ([]byte, error)

RSAEncryptByPublicKey 加密

func SecretToRSACerts

func SecretToRSACerts(secret *v1.Secret) (*rsa.PrivateKey, error)

Types

type ClusterGetter

type ClusterGetter func(string) (*v1beta1.Cluster, error)

type SecretGetter

type SecretGetter func(types.NamespacedName) (*v1.Secret, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL