Documentation
¶
Index ¶
- func DecryptAESKey(encryptedKey []byte, privateKey *rsa.PrivateKey) ([]byte, error)
- func EncryptAESKey(aesKey []byte, publicKey *rsa.PublicKey) ([]byte, error)
- func ExtractPublicKey(privateKey *rsa.PrivateKey) *rsa.PublicKey
- func GenerateAESKey() ([]byte, error)
- func GenerateRSAKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, error)
- func LoadEncryptedAESKey() ([]byte, error)
- func LoadPrivateKey() (*rsa.PrivateKey, error)
- func SaveEncryptedAESKey(encryptedKey []byte) error
- func SavePrivateKey(privateKey *rsa.PrivateKey) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptAESKey ¶
func DecryptAESKey(encryptedKey []byte, privateKey *rsa.PrivateKey) ([]byte, error)
DecryptAESKey decrypts an AES key using the RSA private key.
func EncryptAESKey ¶
EncryptAESKey encrypts an AES key using an RSA public key.
func ExtractPublicKey ¶
func ExtractPublicKey(privateKey *rsa.PrivateKey) *rsa.PublicKey
ExtractPublicKey extracts the RSA public key from a private key.
func GenerateRSAKeyPair ¶
func GenerateRSAKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, error)
GenerateRSAKeyPair generates an RSA private and public key pair.
func LoadEncryptedAESKey ¶
LoadEncryptedAESKey loads the encrypted AES key from a binary file.
func LoadPrivateKey ¶
func LoadPrivateKey() (*rsa.PrivateKey, error)
LoadPrivateKey loads an RSA private key from a PEM file.
func SaveEncryptedAESKey ¶
SaveEncryptedAESKey saves the encrypted AES key to a file.
func SavePrivateKey ¶
func SavePrivateKey(privateKey *rsa.PrivateKey) error
SavePrivateKey saves the RSA private key to a PEM file.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.