cryptor

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenRsaKey

func GenRsaKey(bits int) (prvkey, pubkey []byte, err error)

GenRsaKey generates an PKCS#1 RSA keypair of the given bit size in PEM format.

func RsaDecrypt

func RsaDecrypt(prvkey, cipher []byte) ([]byte, error)

RsaDecrypt decrypts data using rsa private key.

func RsaDecryptBase64

func RsaDecryptBase64(prvkey []byte, data string) ([]byte, error)

RsaDecryptBase64 decrypts data using rsa private key.

func RsaEncrypt

func RsaEncrypt(pubkey, data []byte) ([]byte, error)

RsaEncrypt encrypts data using rsa public key.

func RsaEncryptBase64

func RsaEncryptBase64(pubkey, data []byte) (string, error)

RsaEncryptBase64 encrypts data using rsa public key.

func RsaSign

func RsaSign(prvkey []byte, hash crypto.Hash, data []byte) ([]byte, error)

RsaSign signs using private key in PEM format.

func RsaVerifySign

func RsaVerifySign(pubkey []byte, hash crypto.Hash, data, sig []byte) error

RsaVerifySign verifies signature using public key in PEM format. A valid signature is indicated by returning a nil error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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