rsa

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptPEMRSA added in v1.1.0

func DecryptPEMRSA(ctx context.Context, ciphertext []byte, privatekey []byte) (result []byte, err error)

DecryptPEMRSA Decrypt By RSA using []byte format key

func DecryptRSA

func DecryptRSA(ctx context.Context, ciphertext []byte, privatekey []byte) (result []byte, err error)

DecryptRSA Decrypt By RSA using []byte format key

func EncryptPEMRSA added in v1.1.0

func EncryptPEMRSA(ctx context.Context, plaintext []byte, publickey []byte) (result []byte, err error)

EncryptPEMRSA Encrypt By PEM format RSA using []byte format key

func EncryptRSA

func EncryptRSA(ctx context.Context, plaintext []byte, publickey []byte) (result []byte, err error)

EncryptRSA Encrypt By RSA using []byte format key

func GenCertificate

func GenCertificate(organization []string) (cert tls.Certificate, err error)

Generate Tls certificate

func GenerateCert

func GenerateCert(organization []string) (rawCert, rawKey []byte, err error)

Create private key and self-signed certificate

func GenerateRSAKeypair

func GenerateRSAKeypair(ctx context.Context) (prikey, pubkey []byte, err error)

Generate RSA Keypair to []byte

func GenerateRSAPEMKeypair added in v1.1.0

func GenerateRSAPEMKeypair(ctx context.Context) (prikey, pubkey []byte, err error)

Generate PEM format RSA Keypair

func WriteCerts

func WriteCerts(ctx context.Context, organizaiton []string, path string, name string) (err error)

write certs files to storage

Types

This section is empty.

Jump to

Keyboard shortcuts

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