Documentation ¶
Index ¶
- func Decrypt(ctx context.Context, encryptedBytes []byte, privateKeyStr string) (decryptedBytes []byte, err error)
- func Encrypt(ctx context.Context, plainBytes []byte, rsaPublicKey *rsa.PublicKey) (encryptedBytes []byte, err error)
- func EncryptWithCert(ctx context.Context, plainBytes []byte, publicCert string) (encryptedBytes []byte, err error)
- func EncryptWithKey(ctx context.Context, plainBytes []byte, publicKeyStr string) (encryptedBytes []byte, err error)
- type RsaKeyPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncryptWithCert ¶
Types ¶
type RsaKeyPair ¶
type RsaKeyPair struct { PrivateKey string `json:"private_key" eru:"required"` PublicKey string `json:"public_key" eru:"required"` Bits int `json:"bits" eru:"required"` }
func GenerateKeyPair ¶
func GenerateKeyPair(ctx context.Context, bits int) (rsaKeyPair RsaKeyPair, err error)
Click to show internal directories.
Click to hide internal directories.