Documentation ¶
Index ¶
- Constants
- func AesDecrypt(cypherText []byte, key AesKey) ([]byte, error)
- func AesEncrypt(plainText []byte, key AesKey) ([]byte, error)
- func ExportRsaPrivateKeyAsPemStr(privkey *rsa.PrivateKey) string
- func ExportRsaPublicKeyAsPemStr(pubkey *rsa.PublicKey) (string, error)
- func ParseRsaPrivateKeyFromPemStr(privPEM string) (*rsa.PrivateKey, error)
- func ParseRsaPublicKeyFromPemStr(pubPEM string) (*rsa.PublicKey, error)
- func RsaDecrypt(cipherText []byte, privateKey *rsa.PrivateKey) ([]byte, error)
- func RsaEncrypt(plainText []byte, publicKey *rsa.PublicKey) ([]byte, error)
- type AesKey
- type Keypair
Constants ¶
View Source
const AES_KEY_SIZE = 32
View Source
const RSA_KEY_SIZE = 2048
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
Decrypts a buffer with AES
func AesEncrypt ¶
Encrypts a buffer with AES
func ExportRsaPrivateKeyAsPemStr ¶
func ExportRsaPrivateKeyAsPemStr(privkey *rsa.PrivateKey) string
func ParseRsaPrivateKeyFromPemStr ¶
func ParseRsaPrivateKeyFromPemStr(privPEM string) (*rsa.PrivateKey, error)
func RsaDecrypt ¶
func RsaDecrypt(cipherText []byte, privateKey *rsa.PrivateKey) ([]byte, error)
Types ¶
Click to show internal directories.
Click to hide internal directories.