Documentation ¶
Index ¶
- Variables
- func AesDecrypt(key []byte, encryptedBytes []byte) []byte
- func AesEncrypt(key []byte, plainBytes []byte) []byte
- func GenerateRSAKeyPair() ([]byte, *rsa.PrivateKey)
- func RsaDecryptCipherBytes(encryptedData []byte, privateKey *rsa.PrivateKey) []byte
- func RsaEncryptBytes(plainBytes []byte, publicKey []byte) []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidBlockSize indicates hash blocksize <= 0. ErrInvalidBlockSize = errors.New("invalid blocksize") // ErrInvalidPKCS7Data indicates bad input to PKCS7 pad or unpad. ErrInvalidPKCS7Data = errors.New("invalid PKCS7 data (empty or not padded)") // ErrInvalidPKCS7Padding indicates PKCS7 unpad fails to bad input. ErrInvalidPKCS7Padding = errors.New("invalid padding on input") )
PKCS7 errors.
Functions ¶
func AesDecrypt ¶
AesDecrypt - Decrypt AES encrypted data with the key
func AesEncrypt ¶
func GenerateRSAKeyPair ¶
func GenerateRSAKeyPair() ([]byte, *rsa.PrivateKey)
func RsaDecryptCipherBytes ¶
func RsaDecryptCipherBytes(encryptedData []byte, privateKey *rsa.PrivateKey) []byte
func RsaEncryptBytes ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.