Skip to content
Snippets Groups Projects
Commit cf82f74e authored by Adrien Béraud's avatar Adrien Béraud
Browse files

python: add PrivateKey::generateEC support

parent a952ddec
Branches
Tags
No related merge requests found
...@@ -267,6 +267,11 @@ cdef class PrivateKey(_WithID): ...@@ -267,6 +267,11 @@ cdef class PrivateKey(_WithID):
k = PrivateKey() k = PrivateKey()
k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generate()) k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generate())
return k return k
@staticmethod
def generateEC():
k = PrivateKey()
k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generateEC())
return k
cdef class PublicKey(_WithID): cdef class PublicKey(_WithID):
cdef cpp.PublicKey _key cdef cpp.PublicKey _key
......
...@@ -89,6 +89,8 @@ cdef extern from "opendht/crypto.h" namespace "dht::crypto": ...@@ -89,6 +89,8 @@ cdef extern from "opendht/crypto.h" namespace "dht::crypto":
Blob decrypt(Blob data) const Blob decrypt(Blob data) const
@staticmethod @staticmethod
PrivateKey generate() PrivateKey generate()
@staticmethod
PrivateKey generateEC()
cdef cppclass PublicKey: cdef cppclass PublicKey:
PublicKey() PublicKey()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment