Documentation ¶
Index ¶
- func AccessAuth(c *gin.Context) (string, error)
- func AccessAuth_Detached(key_id string) (string, error)
- func BytesToCert(cert []byte) (*x509.Certificate, error)
- func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error)
- func BytesToPublicKey(pub []byte) (*rsa.PublicKey, error)
- func CertTemplate(cn string, validYear int) (*x509.Certificate, error)
- func CertToBytes(crt *x509.Certificate) ([]byte, error)
- func CheckIfSliceContains[T comparable](slice []T, ele T) bool
- func CreateCert(template, parent *x509.Certificate, pub interface{}, parentPriv interface{}) (cert *x509.Certificate, certPEM []byte, err error)
- func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)
- func DecryptWithSymmetricKey(key []byte, file_byte []byte) ([]byte, error)
- func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) ([]byte, error)
- func EncryptWithSymmetricKey(key []byte, file_byte []byte) ([]byte, error)
- func GenKeyPair(keylen int) (*rsa.PrivateKey, *rsa.PublicKey)
- func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func GetContextClusterPublicKeyBytes(context_nm string) ([]byte, error)
- func GetContextUserCertificateBytes(context_nm string) ([]byte, error)
- func GetContextUserCertificateBytes_Detached(config_b []byte, context_nm string) ([]byte, error)
- func GetContextUserPrivateKeyBytes(context_nm string) ([]byte, error)
- func GetContextUserPublicKeyBytes(context_nm string) ([]byte, error)
- func GetContextUserPublicKeyBytes_Detached(config_b []byte, context_nm string) ([]byte, error)
- func GetKubeConfigPath() (string, error)
- func GetRandIntInRange(min int, max int) int
- func PrivateKeyToBytes(priv *rsa.PrivateKey) ([]byte, error)
- func PublicKeyToBytes(pub *rsa.PublicKey) ([]byte, error)
- func RandomHex(n int) (string, error)
- func VerifyChallange_Key(answer ChallengRecord) (string, error)
- type CertSet
- type ChallengRecord
- type KeyRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessAuth_Detached ¶
func BytesToCert ¶
func BytesToCert(cert []byte) (*x509.Certificate, error)
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error)
func CertTemplate ¶
func CertTemplate(cn string, validYear int) (*x509.Certificate, error)
func CertToBytes ¶
func CertToBytes(crt *x509.Certificate) ([]byte, error)
func CheckIfSliceContains ¶
func CheckIfSliceContains[T comparable](slice []T, ele T) bool
func CreateCert ¶
func CreateCert(template, parent *x509.Certificate, pub interface{}, parentPriv interface{}) (cert *x509.Certificate, certPEM []byte, err error)
func DecryptWithPrivateKey ¶
func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)
func DecryptWithSymmetricKey ¶
func EncryptWithPublicKey ¶
func EncryptWithSymmetricKey ¶
func GenKeyPair ¶
func GenKeyPair(keylen int) (*rsa.PrivateKey, *rsa.PublicKey)
func GenerateKeyPair ¶
func GetKubeConfigPath ¶
func GetRandIntInRange ¶
func PrivateKeyToBytes ¶
func PrivateKeyToBytes(priv *rsa.PrivateKey) ([]byte, error)
func VerifyChallange_Key ¶
func VerifyChallange_Key(answer ChallengRecord) (string, error)
Types ¶
type CertSet ¶
type CertSet struct { RootCertPEM []byte RootKeyPEM []byte RootPubPEM []byte ClientCertPEM []byte ClientKeyPEM []byte ClientPubPEM []byte ServCertPEM []byte ServKeyPEM []byte ServPubPEM []byte }
func NewCertsPipeline ¶
func NewCertsPipeline() *CertSet
type ChallengRecord ¶
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)
func GenerateChallenge_Key ¶
func GenerateChallenge_Key(email string, pub_str string) (ChallengRecord, error)
type KeyRecord ¶
func VerifyChallange ¶
func VerifyChallange(answer ChallengRecord) (string, KeyRecord, error)
func VerifyChallange_Detached ¶
func VerifyChallange_Detached(config_b []byte, answer ChallengRecord) (string, KeyRecord, error)
Click to show internal directories.
Click to hide internal directories.