rsakey

package
v0.0.0-...-3a86166 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: GPL-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(cryted []byte, key []byte) []byte

func AesEncrypt

func AesEncrypt(orig []byte, key []byte) []byte

func DecryptRsa

func DecryptRsa(encData []byte, priv *rsa.PrivateKey) (data []byte, err error)

func EncryptRSA

func EncryptRSA(data []byte, pub *rsa.PublicKey) (encData []byte, err error)

func GenerateKeyPair

func GenerateKeyPair(bitsCnt int) (*rsa.PrivateKey, *rsa.PublicKey)

func KeyGenerated

func KeyGenerated(ph string) bool

func LoadRSAKey

func LoadRSAKey(savePath string, passwd []byte) (priv *rsa.PrivateKey, pub *rsa.PublicKey, err error)

func PKCS7Padding

func PKCS7Padding(ciphertext []byte, blocksize int) []byte

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

func ParsePubKey

func ParsePubKey(pubkey []byte) (pub *rsa.PublicKey, err error)

func PubKey2Addr

func PubKey2Addr(pk *rsa.PublicKey) string

func PubKeyBytes2Addr

func PubKeyBytes2Addr(pubk []byte) string

func PubKeyToBytes

func PubKeyToBytes(pub *rsa.PublicKey) (pubkey []byte, err error)

func Save2File

func Save2File(savePath string, privKey *rsa.PrivateKey, password string) error

func SignRSA

func SignRSA(data []byte, priv *rsa.PrivateKey) (signData []byte, err error)

func VerifyRSA

func VerifyRSA(data []byte, sig []byte, pub *rsa.PublicKey) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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