aboutsummaryrefslogtreecommitdiff
path: root/libcmix-crypto/keypair.h
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-08-31 12:48:49 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-08-31 12:49:44 +0200
commitd55e5c77d3cd2a1be150666e92e5b4f3b922f0fc (patch)
tree123d2ede09cbb92c6584bea85c62b4aaa515a154 /libcmix-crypto/keypair.h
parent33675c85dcf0bc500a8fb99ea6766f6a4624d0ad (diff)
downloadcmix-d55e5c77d3cd2a1be150666e92e5b4f3b922f0fc.tar.gz
cmix-d55e5c77d3cd2a1be150666e92e5b4f3b922f0fc.tar.bz2
cmix-d55e5c77d3cd2a1be150666e92e5b4f3b922f0fc.zip
Restructered libcmix-crypto, hiding implementation specifics.
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