Documentation ¶
Index ¶
- func BytesToPrivateKey(priv []byte) (sk *rsa.PrivateKey, err error)
- func BytesToPublicKey(pub []byte) (pk *rsa.PublicKey, err error)
- func Decrypt(ciphered, privateKeyBytes []byte) ([]byte, error)
- func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)
- func Encrypt(msg, publicKeyBytes []byte) ([]byte, error)
- func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) ([]byte, error)
- func GenerateKeyPair(bits int) (sk *rsa.PrivateKey, pk *rsa.PublicKey, err error)
- func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
- func PublicKeyToBytes(pub *rsa.PublicKey) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv []byte) (sk *rsa.PrivateKey, err error)
BytesToPrivateKey converts bytes to private key
func BytesToPublicKey ¶
BytesToPublicKey converts bytes to public key
func DecryptWithPrivateKey ¶
func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)
DecryptWithPrivateKey decrypts data with private key
func EncryptWithPublicKey ¶
EncryptWithPublicKey encrypts data with public key
func GenerateKeyPair ¶
GenerateKeyPair generates a new key pair
func PrivateKeyToBytes ¶
func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
PrivateKeyToBytes transforms private key to bytes
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.