rsa

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(privateKey string, cipherText string, passphrase string) string

RSA Decrypt

func Encrypt

func Encrypt(publicKey string, plainText string, passphrase string) string

RSA Encrypt

func PemToPrivateKey

func PemToPrivateKey(privKey []byte, passphrase string) *rsa.PrivateKey

PemToPrivateKey converts pem string to a private key.

func PemToPublicKey

func PemToPublicKey(pubKey []byte, passphrase string) *rsa.PublicKey

PemToPublicKey converts pem string to a public key.

func PrivateKeyToBytes

func PrivateKeyToBytes(privKey *rsa.PrivateKey, passphrase string) []byte

PrivateKeyToBytes converts a private key to bytes.

func PublicKeyToBytes

func PublicKeyToBytes(pub *rsa.PublicKey, passphrase string) []byte

PublicKeyToBytes converts a public key to bytes.

Types

type KeyPair

type KeyPair struct {
	PrivateKey string
	PublicKey  string
}

func GenerateKeyPair

func GenerateKeyPair(keySize int, passphrase string) KeyPair

Generates a new RSA key pair.

Jump to

Keyboard shortcuts

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