Documentation ¶
Index ¶
- func Base64DecryptWithPrivateKey(ciphertextEnc string, priv *rsa.PrivateKey) []byte
- func Base64EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) string
- func Base64ToPublicKey(pub string) *rsa.PublicKey
- func BytesToPrivateKey(priv []byte) *rsa.PrivateKey
- func ChunkAndEncrypt(msg []byte, pub *rsa.PublicKey) []byte
- func DecryptChunked(ciphertext []byte, priv *rsa.PrivateKey) []byte
- func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) []byte
- func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) []byte
- func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey)
- func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
- func PublicKeyToBase64(pub *rsa.PublicKey) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64DecryptWithPrivateKey ¶
func Base64DecryptWithPrivateKey(ciphertextEnc string, priv *rsa.PrivateKey) []byte
DecryptWithPrivateKey decrypts base64 encoded data with private key
func Base64EncryptWithPublicKey ¶
EncryptWithPublicKey encrypts data with public key and encode it with base64
func Base64ToPublicKey ¶
Base64ToPublicKey base64 encoded to public key
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv []byte) *rsa.PrivateKey
BytesToPrivateKey bytes to private key
func ChunkAndEncrypt ¶
Split message in multiple chunk before encrypt it to avoid the key size limitation
func DecryptChunked ¶
func DecryptChunked(ciphertext []byte, priv *rsa.PrivateKey) []byte
Decrypt a message which has been encrypted using ChunkAndEncrypt
func DecryptWithPrivateKey ¶
func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) []byte
DecryptWithPrivateKey decrypts data with private key
func EncryptWithPublicKey ¶
EncryptWithPublicKey encrypts data with public key
func GenerateKeyPair ¶
func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey)
GenerateKeyPair generates a new key pair
func PrivateKeyToBytes ¶
func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
PrivateKeyToBytes private key to bytes
func PublicKeyToBase64 ¶
PublicKeyToBytes public key to base64 encoding
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.