python: add crypto encrypt/decrypt

This commit is contained in:
Adrien Beraud committed 2017-04-27 03:34:04 +02:00
1 parent fa7efd086f
commit a952ddec53
2 files changed
+22

No files matched your search

+4
View File
@@ -77,6 +77,8 @@ cdef extern from "opendht/sockaddr.h" namespace "dht":
sa_family_t getFamily() const
void setFamily(sa_family_t f)
ctypedef vector[uint8_t] Blob
cdef extern from "opendht/crypto.h" namespace "dht::crypto":
ctypedef pair[shared_ptr[PrivateKey], shared_ptr[Certificate]] Identity
cdef Identity generateIdentity(string name, Identity ca, unsigned bits)
@@ -84,12 +86,14 @@ cdef extern from "opendht/crypto.h" namespace "dht::crypto":
cdef cppclass PrivateKey:
PrivateKey()
PublicKey getPublicKey() const
Blob decrypt(Blob data) const
@staticmethod
PrivateKey generate()
cdef cppclass PublicKey:
PublicKey()
InfoHash getId() const
Blob encrypt(Blob data) const
cdef cppclass Certificate:
Certificate()