From d55e5c77d3cd2a1be150666e92e5b4f3b922f0fc Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Wed, 31 Aug 2016 12:48:49 +0200 Subject: Restructered libcmix-crypto, hiding implementation specifics. --- libcmix-crypto/keypair.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 libcmix-crypto/keypair.h (limited to 'libcmix-crypto/keypair.h') 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 + +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 -- cgit v1.2.3-70-g09d2