rsa

package
Version: v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package rsa provides rsa encryption/decryption utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

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

Decrypt from rsa string

func DecryptBase64

func DecryptBase64(input []byte, privateKey ...[]byte) ([]byte, error)

DecryptBase64 decrypt from base64 string

func DecryptLongString added in v1.4.0

func DecryptLongString(cipherText string, publicKey, privateKey []byte) (result string, err error)

DecryptLongString decrypt long string from base64 string

func Encrypt

func Encrypt(input []byte, publicKey ...[]byte) ([]byte, error)

Encrypt to rsa string

func EncryptBase64

func EncryptBase64(input []byte, publicKey ...[]byte) ([]byte, error)

EncryptBase64 encrypt to base64 string

func EncryptLongString added in v1.4.0

func EncryptLongString(raw string, publicKey []byte) (result string, err error)

EncryptLongString encrypt long string to base64 string

func GenKeys added in v1.4.0

func GenKeys(publicKeyWriter, privateKeyWriter io.Writer, keyLength int) error

GenKeys Generate public key and private key

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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