Documentation
¶
Index ¶
- Constants
- func BuildConfig(clusterName string, connect v1beta1.ConnectConfig, secretGetter SecretGetter) (*rest.Config, error)
- func BuildSecret(key types.NamespacedName) (*v1.Secret, *rsa.PrivateKey, error)
- func CertsToSecret(key []byte, sec types.NamespacedName) *v1.Secret
- func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte
- func GetConfigOrDie(master, kubeConfig string) *rest.Config
- func NewPrivateKey() (*rsa.PrivateKey, error)
- func RSADecryptByPrivateKey(cipherText []byte, key *rsa.PrivateKey) ([]byte, error)
- func RSAEncryptByPublicKey(plainText []byte, key *rsa.PublicKey) ([]byte, error)
- func SecretToRSACerts(secret *v1.Secret) (*rsa.PrivateKey, error)
- type ClusterGetter
- type SecretGetter
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)
Click to show internal directories.
Click to hide internal directories.