crypto

package
v0.11.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package crypto implements the crypto functions

Package crypto implements the crypto functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeFromBase64

func DecodeFromBase64(data string) (string, error)

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

func EncodeToBase64(data string) string

EncodeToBase64 encodes a string to base64

func EncryptTokenToJWE

func EncryptTokenToJWE(token string, publicKey *rsa.PublicKey) (string, error)

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.

Jump to

Keyboard shortcuts

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