Ellipticsecure PKCS11共享库的Python绑定

ehsm的Python项目详细描述


python libehsm是用于ellipticsecure pkcs11共享库的python包装器

注意,虽然包装器确实导出了一些pkcs 11 helper 函数它只执行部分操作-还有其他包装器 可与PKCS 11接口。

这个包装器的重点是导出bip32/比特币特定的函数。

安装

在此处下载并安装平台的本机共享库:https://ellipticsecure.com/downloads/

pip安装python libehsm

示例

使用存储在 mirkey或ehsm设备:

importehsmmirkey=ehsm.load_ehsm()# Get the available device slotsslots=mirkey.enumerate_slots()iflen(slots)>0:# Use the first available slotslot=slots[0]# Initialize the librarymirkey.init()try:session=mirkey.get_logged_in_rw_session(slot,b"testsu")found=mirkey.bip32_has_root_key(session)iffound:hash=bytes(32)# list of integers representing a bip32 path to the derived key# # ie. this is "m/0", "m" would be []indexes=[0]sig=mirkey.bip32_sign_data(session,hash,indexes)finally:mirkey.finalize()else:print"No devices found"

有关更多使用示例,请参见测试用例。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java JSon根据应用于其他节点的条件选择节点?   c#Xamarin抛出Java。Lang.ClassNotFoundException使用CallRedirectionService   java如何在spring boot中使用hibernatespatial和locationtech在查询中创建mysql?   java如何将图像数据复制到BuffereImage的子类中?   java JSP对内部类使用forEach   java Maven surefire插件在许多测试中不运行单个测试   客户端的java Android GAE多态性   java在选择新值时获取SWT组合的上一个值   java将同名单选按钮传递给servlet   预约系统的javaswinggui   java为什么是扫描仪。下一步()不接受键盘回车键?   java领域生成的代码错误:返回类型Integer与int不兼容   LWJGL中的opengl Java绑定纹理导致白色屏幕   解密使用Java加密的MySQL字段