Documentation ¶
Index ¶
- func BytesToPrivateKey(priv []byte, password []byte) (*rsa.PrivateKey, error)
- func BytesToPublicKey(pub []byte) (*rsa.PublicKey, error)
- func DecryptAES(ciphertext []byte, aesKey []byte, initialVector []byte) ([]byte, error)
- func DecryptGCM(cipherBytes []byte, aesKey []byte, initialVector []byte) ([]byte, error)
- func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)
- func EncryptAES(plaintext []byte, aesKey []byte, initialVector []byte) ([]byte, error)
- func EncryptGCM(plainBytes []byte, aesKey []byte, initialVector []byte) ([]byte, error)
- func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) ([]byte, error)
- func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func PadAESBlockSize(src []byte) []byte
- func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
- func PublicKeyToBytes(pub *rsa.PublicKey) ([]byte, error)
- func UnpadAESBlockSize(src []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv []byte, password []byte) (*rsa.PrivateKey, error)
BytesToPrivateKey bytes to private key
func BytesToPublicKey ¶
BytesToPublicKey bytes to public key
func DecryptAES ¶
DecryptAES decrypts data with aes key and initial vector
func DecryptGCM ¶
func DecryptWithPrivateKey ¶
func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)
DecryptWithPrivateKey decrypts data with private key
func EncryptAES ¶
EncryptAES encrypts data with aes key and initial vector
func EncryptGCM ¶
func EncryptWithPublicKey ¶
EncryptWithPublicKey encrypts data with public key
func GenerateKeyPair ¶
GenerateKeyPair generates a new key pair
func PadAESBlockSize ¶
func PrivateKeyToBytes ¶
func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
PrivateKeyToBytes private key to bytes
func PublicKeyToBytes ¶
PublicKeyToBytes public key to bytes
func UnpadAESBlockSize ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.