Documentation ¶
Index ¶
- func BytesToPublicKey(pub []byte) (*rsa.PublicKey, error)
- func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) ([]byte, error)
- func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func GeneratePrivateKeyAndPublicKey(bits int, privateKeyFilePath string, publicKeyFilePath string) error
- func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
- func PublicKeyToBytes(pub *rsa.PublicKey) ([]byte, error)
- func ReadPublicKey(publicKeyFilePath string) (*rsa.PublicKey, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToPublicKey ¶
BytesToPublicKey bytes to public 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 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.