python: add PrivateKey::generateEC support

This commit is contained in:
Adrien Beraud committed 2017-04-27 04:45:59 +02:00
1 parent a952ddec53
commit cf82f74e15
2 files changed
+7

No files matched your search

+5
View File
@@ -267,6 +267,11 @@ cdef class PrivateKey(_WithID):
k = PrivateKey()
k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generate())
return k
@staticmethod
def generateEC():
k = PrivateKey()
k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generateEC())
return k
cdef class PublicKey(_WithID):
cdef cpp.PublicKey _key
+2
View File
@@ -89,6 +89,8 @@ cdef extern from "opendht/crypto.h" namespace "dht::crypto":
Blob decrypt(Blob data) const
@staticmethod
PrivateKey generate()
@staticmethod
PrivateKey generateEC()
cdef cppclass PublicKey:
PublicKey()