modules

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessAuth

func AccessAuth(c *gin.Context) (string, error)

func AccessAuth_Detached

func AccessAuth_Detached(key_id string) (string, error)

func BytesToPrivateKey

func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error)

func BytesToPublicKey

func BytesToPublicKey(pub []byte) (*rsa.PublicKey, error)

func CheckIfSliceContains

func CheckIfSliceContains[T comparable](slice []T, ele T) bool

func DecryptWithPrivateKey

func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)

func DecryptWithSymmetricKey

func DecryptWithSymmetricKey(key []byte, file_byte []byte) ([]byte, error)

func EncryptWithPublicKey

func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) ([]byte, error)

func EncryptWithSymmetricKey

func EncryptWithSymmetricKey(key []byte, file_byte []byte) ([]byte, error)

func GenerateKeyPair

func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)

func GetContextClusterPublicKeyBytes

func GetContextClusterPublicKeyBytes(context_nm string) ([]byte, error)

func GetContextUserCertificateBytes

func GetContextUserCertificateBytes(context_nm string) ([]byte, error)

func GetContextUserCertificateBytes_Detached

func GetContextUserCertificateBytes_Detached(config_b []byte, context_nm string) ([]byte, error)

func GetContextUserPrivateKeyBytes

func GetContextUserPrivateKeyBytes(context_nm string) ([]byte, error)

func GetContextUserPublicKeyBytes

func GetContextUserPublicKeyBytes(context_nm string) ([]byte, error)

func GetContextUserPublicKeyBytes_Detached

func GetContextUserPublicKeyBytes_Detached(config_b []byte, context_nm string) ([]byte, error)

func GetKubeConfigPath

func GetKubeConfigPath() (string, error)

func GetRandIntInRange

func GetRandIntInRange(min int, max int) int

func PrivateKeyToBytes

func PrivateKeyToBytes(priv *rsa.PrivateKey) ([]byte, error)

func PublicKeyToBytes

func PublicKeyToBytes(pub *rsa.PublicKey) ([]byte, error)

func RandomHex

func RandomHex(n int) (string, error)

Types

type ChallengRecord

type ChallengRecord map[string]map[string]string

func GenerateChallenge

func GenerateChallenge(client_ca_pub_key ChallengRecord) (ChallengRecord, error)

func GenerateChallenge_Detached

func GenerateChallenge_Detached(config_b []byte, client_ca_pub_key ChallengRecord) (ChallengRecord, error)

type KeyRecord

type KeyRecord map[string]string

func VerifyChallange

func VerifyChallange(answer ChallengRecord) (string, KeyRecord, error)

func VerifyChallange_Detached

func VerifyChallange_Detached(config_b []byte, answer ChallengRecord) (string, KeyRecord, error)

Jump to

Keyboard shortcuts

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