rsa

package
v0.0.0-...-6dc645d Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ctx context.Context, encryptedBytes []byte, privateKeyStr string) (decryptedBytes []byte, err error)

func Encrypt

func Encrypt(ctx context.Context, plainBytes []byte, rsaPublicKey *rsa.PublicKey) (encryptedBytes []byte, err error)

func EncryptWithCert

func EncryptWithCert(ctx context.Context, plainBytes []byte, publicCert string) (encryptedBytes []byte, err error)

func EncryptWithKey

func EncryptWithKey(ctx context.Context, plainBytes []byte, publicKeyStr string) (encryptedBytes []byte, err error)

Types

type RsaKeyPair

type RsaKeyPair struct {
	PrivateKey string `json:"private_key" eru:"required"`
	PublicKey  string `json:"public_key" eru:"required"`
	Bits       int    `json:"bits" eru:"required"`
}

func GenerateKeyPair

func GenerateKeyPair(ctx context.Context, bits int) (rsaKeyPair RsaKeyPair, err error)

Jump to

Keyboard shortcuts

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