rsa

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciphertext, privateKey []byte) ([]byte, error)

Decrypt RSA decrypt ciphertext using private key

func DecryptFromBase64

func DecryptFromBase64(base64Ciphertext, base64PrivateKey string) ([]byte, error)

DecryptFromBase64 base64 decode ciphertext and RSA decrypt

func Encrypt

func Encrypt(plaintext, publicKey []byte) ([]byte, error)

Encrypt RSA encrypt plaintext using public key

func EncryptToBase64

func EncryptToBase64(plaintext []byte, base64PublicKey string) (string, error)

EncryptToBase64 RSA encrypt plaintext and base64 encode ciphertext

Types

type RSAKey

type RSAKey struct {
	PrivateKey string
	PublicKey  string
}

RSAKey RSA key pair

func GenerateRSAKey

func GenerateRSAKey() (*RSAKey, error)

GenerateKey generate RSA key pair

Jump to

Keyboard shortcuts

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