aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/keypair.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-05 23:20:10 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-05 23:20:10 +0000
commitc13d594abf0c2c1f75b7b55573a047b757e2c2ec (patch)
tree786cb607a6601eda9b30812927cfac9f6be48521 /src/libcryptobox/keypair.h
parentc712ffe5b94f3087e53c637352584d120ebc8452 (diff)
downloadrspamd-c13d594abf0c2c1f75b7b55573a047b757e2c2ec.tar.gz
rspamd-c13d594abf0c2c1f75b7b55573a047b757e2c2ec.zip
Rework HTTP encryption
Diffstat (limited to 'src/libcryptobox/keypair.h')
-rw-r--r--src/libcryptobox/keypair.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/libcryptobox/keypair.h b/src/libcryptobox/keypair.h
index 80d50b2f3..bd82b64ae 100644
--- a/src/libcryptobox/keypair.h
+++ b/src/libcryptobox/keypair.h
@@ -127,5 +127,48 @@ enum rspamd_cryptobox_mode rspamd_pubkey_alg (struct rspamd_cryptobox_pubkey *p)
*/
const guchar * rspamd_pubkey_get_nm (struct rspamd_cryptobox_pubkey *p);
+/**
+ * Calculate and store nm value for the specified local key (performs ECDH)
+ * @param p
+ * @return
+ */
+const guchar * rspamd_pubkey_calculate_nm (struct rspamd_cryptobox_pubkey *p,
+ struct rspamd_cryptobox_keypair *kp);
+
+/**
+ * Get raw public key id for a specified keypair (rspamd_cryptobox_HASHBYTES)
+ * @param kp
+ * @return
+ */
+const guchar * rspamd_keypair_get_id (struct rspamd_cryptobox_keypair *kp);
+/**
+ * Get raw public key id for a specified key (rspamd_cryptobox_HASHBYTES)
+ * @param kp
+ * @return
+ */
+const guchar * rspamd_pubkey_get_id (struct rspamd_cryptobox_pubkey *pk);
+
+
+/** Print pubkey */
+#define RSPAMD_KEYPAIR_PUBKEY 0x1
+/** Print secret key */
+#define RSPAMD_KEYPAIR_PRIVKEY 0x2
+/** Print key id */
+#define RSPAMD_KEYPAIR_ID 0x4
+/** Print short key id */
+#define RSPAMD_KEYPAIR_ID_SHORT 0x8
+/** Encode output with base 32 */
+#define RSPAMD_KEYPAIR_BASE32 0x10
+/** Human readable output */
+#define RSPAMD_KEYPAIR_HUMAN 0x20
+#define RSPAMD_KEYPAIR_HEX 0x40
+/**
+ * Print keypair encoding it if needed
+ * @param key key to print
+ * @param how flags that specifies printing behaviour
+ * @return newly allocated string with keypair
+ */
+GString *rspamd_keypair_print (struct rspamd_cryptobox_keypair *kp,
+ guint how);
#endif /* SRC_LIBCRYPTOBOX_KEYPAIR_H_ */