aboutsummaryrefslogtreecommitdiff
path: root/libcmix-crypto/keypair.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcmix-crypto/keypair.h')
-rw-r--r--libcmix-crypto/keypair.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/libcmix-crypto/keypair.h b/libcmix-crypto/keypair.h
new file mode 100644
index 0000000..90cf16b
--- /dev/null
+++ b/libcmix-crypto/keypair.h
@@ -0,0 +1,30 @@
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdlib.h>
+
+struct KeyPair;
+
+typedef void(*KeyPairDeleter)(struct KeyPair*);
+
+void keypair_deleter(struct KeyPair* p) ;
+
+struct KeyPair {
+ char* sec;
+ char* pub;
+ unsigned int sec_len;
+ unsigned int pub_len;
+ KeyPairDeleter deleter;
+};
+
+void keypair_deleter(struct KeyPair* p) {
+ free(p->sec);
+ free(p->pub);
+}
+
+#ifdef __cplusplus
+}
+#endif