aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/keypair.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-06 14:09:21 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-06 14:09:21 +0000
commit524b67ba88ffd3c00160ad0b6cd3f8bffefb7263 (patch)
tree2212653f6feadc42a6ac3c71d7a7727668b46259 /src/libcryptobox/keypair.h
parentab780d6f7531cb8277609aedffbb4376d821f6ff (diff)
downloadrspamd-524b67ba88ffd3c00160ad0b6cd3f8bffefb7263.tar.gz
rspamd-524b67ba88ffd3c00160ad0b6cd3f8bffefb7263.zip
Add routines to print pubkey components
Diffstat (limited to 'src/libcryptobox/keypair.h')
-rw-r--r--src/libcryptobox/keypair.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libcryptobox/keypair.h b/src/libcryptobox/keypair.h
index 697e06a3d..f913cfc65 100644
--- a/src/libcryptobox/keypair.h
+++ b/src/libcryptobox/keypair.h
@@ -169,6 +169,8 @@ const guchar * rspamd_pubkey_get_id (struct rspamd_cryptobox_pubkey *pk);
const guchar * rspamd_pubkey_get_pk (struct rspamd_cryptobox_pubkey *pk,
guint *len);
+/** Short ID characters count */
+#define RSPAMD_KEYPAIR_SHORT_ID_LEN 5
/** Print pubkey */
#define RSPAMD_KEYPAIR_PUBKEY 0x1
/** Print secret key */
@@ -191,6 +193,15 @@ const guchar * rspamd_pubkey_get_pk (struct rspamd_cryptobox_pubkey *pk,
GString *rspamd_keypair_print (struct rspamd_cryptobox_keypair *kp,
guint how);
+/**
+ * Print pubkey encoding it if needed
+ * @param key key to print
+ * @param how flags that specifies printing behaviour
+ * @return newly allocated string with keypair
+ */
+GString *rspamd_pubkey_print (struct rspamd_cryptobox_pubkey *pk,
+ guint how);
+
/** Get keypair pubkey ID */
#define RSPAMD_KEYPAIR_COMPONENT_ID 0
/** Get keypair public key */