Documentation
¶
Index ¶
- func BytesToPrivateKey(priv []byte) *rsa.PrivateKey
- func DecryptBytes(encrypted []byte) ([]byte, error)
- func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)
- func GenerateRSA_Keys(bits int) (*rsa.PrivateKey, *rsa.PublicKey)
- func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
- func PublicKeyToBytes(pub *rsa.PublicKey) []byte
- func SaveKeys()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv []byte) *rsa.PrivateKey
BytesToPrivateKey bytes to private key
func DecryptBytes ¶
DecryptBytes decrypts json body to bytes
func DecryptWithPrivateKey ¶
func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)
DecryptWithPrivateKey decrypts data with private key
func GenerateRSA_Keys ¶
func GenerateRSA_Keys(bits int) (*rsa.PrivateKey, *rsa.PublicKey)
This function generates RSA public and private keys for end to end encryption
func PrivateKeyToBytes ¶
func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
This function parses the private key to bytes
func PublicKeyToBytes ¶
PublicKeyToBytes public key to bytes
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.