Documentation
¶
Overview ¶
Package crypto implements the crypto functions
Package crypto implements the crypto functions
Index ¶
- func DecodeFromBase64(data string) (string, error)
- func DecryptJWEToken(jweToken string, privateKey *rsa.PrivateKey) (string, error)
- func EncodeToBase64(data string) string
- func EncryptTokenToJWE(token string, publicKey *rsa.PublicKey) (string, error)
- func ExportPrivateKeyAsPEM(privateKey *rsa.PrivateKey) string
- func ExportPublicKeyAsPEM(privateKey *rsa.PrivateKey) (string, error)
- func GenerateRSAKeyPair() (*rsa.PrivateKey, error)
- func ImportPrivateKeyFromPEM(privateKeyPEM string) (*rsa.PrivateKey, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeFromBase64 ¶
DecodeFromBase64 decodes a base64 string
func DecryptJWEToken ¶
func DecryptJWEToken(jweToken string, privateKey *rsa.PrivateKey) (string, error)
DecryptJWEToken decrypts a JWE token using the provided private key
func EncodeToBase64 ¶
EncodeToBase64 encodes a string to base64
func EncryptTokenToJWE ¶
EncryptTokenToJWE encrypts a token using JWE with the provided public key
func ExportPrivateKeyAsPEM ¶
func ExportPrivateKeyAsPEM(privateKey *rsa.PrivateKey) string
ExportPrivateKeyAsPEM exports the private key in PEM format
func ExportPublicKeyAsPEM ¶
func ExportPublicKeyAsPEM(privateKey *rsa.PrivateKey) (string, error)
ExportPublicKeyAsPEM exports the public key in PEM format
func GenerateRSAKeyPair ¶
func GenerateRSAKeyPair() (*rsa.PrivateKey, error)
GenerateRSAKeyPair generates a new RSA private and public key pair
func ImportPrivateKeyFromPEM ¶
func ImportPrivateKeyFromPEM(privateKeyPEM string) (*rsa.PrivateKey, error)
ImportPrivateKeyFromPEM imports a private key from PEM format
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.