Documentation
¶
Index ¶
- func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) []byte
- func EncryptWithPublicKey(ciphertext []byte, pubKey *rsa.PublicKey) []byte
- func GeneratePEMKeys(priKeyPath string, pubKeyPath string)
- func LoadPemKeyFromFile(fileName string) (privateKey *rsa.PrivateKey, err error)
- func LoadPemPubKeyFromFile(fileName string) (publicKey *rsa.PublicKey, err error)
- func LoadPrivKeyFromString(privKey []byte) (privateKey *rsa.PrivateKey, err error)
- func LoadPubKeyFromString(pubKey string) (publicKey *rsa.PublicKey, err error)
- func SavePEMKey(fileName string, key *rsa.PrivateKey)
- func SavePublicPEMKey(fileName string, pubKey rsa.PublicKey)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptWithPrivateKey ¶
func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) []byte
DecryptWithPrivateKey decrypts data with private key
func EncryptWithPublicKey ¶
EncryptWithPublicKey function
func GeneratePEMKeys ¶
GeneratePEMKeys and save them
func LoadPemKeyFromFile ¶
func LoadPemKeyFromFile(fileName string) (privateKey *rsa.PrivateKey, err error)
LoadPemKeyFromFile function
func LoadPemPubKeyFromFile ¶
LoadPemPubKeyFromFile function
func LoadPrivKeyFromString ¶
func LoadPrivKeyFromString(privKey []byte) (privateKey *rsa.PrivateKey, err error)
LoadPrivKeyFromString function
func LoadPubKeyFromString ¶
LoadPubKeyFromString function
func SavePublicPEMKey ¶
SavePublicPEMKey to file
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.