diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-19 15:42:02 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-19 15:42:02 +0100 |
commit | 8fb0982059b332bb0eab66ab11b74c52047f73ea (patch) | |
tree | 71ddd49cc8b588eb629f1cf142d293bad4356c99 /src/libcryptobox/keypair.h | |
parent | 2013b2d0919a45ae8a8297a8ba7eafd72f410d5c (diff) | |
download | rspamd-8fb0982059b332bb0eab66ab11b74c52047f73ea.tar.gz rspamd-8fb0982059b332bb0eab66ab11b74c52047f73ea.zip |
[Minor] Add method to encrypt and seal data using keypair
Diffstat (limited to 'src/libcryptobox/keypair.h')
-rw-r--r-- | src/libcryptobox/keypair.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libcryptobox/keypair.h b/src/libcryptobox/keypair.h index fc17412e2..3e78e7cbb 100644 --- a/src/libcryptobox/keypair.h +++ b/src/libcryptobox/keypair.h @@ -287,5 +287,22 @@ gboolean rspamd_keypair_decrypt (struct rspamd_cryptobox_keypair *kp, guchar **out, gsize *outlen, GError **err); +/** + * Encrypts data usign specific keypair. + * This method actually generates ephemeral local keypair, use public key from + * the remote keypair and encrypts data + * @param kp keypair + * @param in raw input + * @param inlen input length + * @param out output (allocated internally using g_malloc) + * @param outlen output size + * @param err pointer to error + * @return TRUE if encryption has been completed, out must be freed in this case + */ +gboolean rspamd_keypair_encrypt (struct rspamd_cryptobox_keypair *kp, + const guchar *in, gsize inlen, + guchar **out, gsize *outlen, + GError **err); + #endif /* SRC_LIBCRYPTOBOX_KEYPAIR_H_ */ |