Coder Social home page Coder Social logo

gmssl-python's Issues

SM2相关example例程运行报错

开发者您好,我电脑win11 64位系统,python版本是3.12.0
已经正确安装gmssl和gmssl-python如下:

>>> import gmssl
>>> gmssl.GMSSL_PYTHON_VERSION
'2.2.2'
>>> gmssl.GMSSL_LIBRARY_VERSION
'GmSSL 3.1.1 Dev'

我在测试example文件夹下的例程时,sm3.py和sm4.py运行正常,sm2_key.py运行时报错如下:

File "C:\Users\admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\gmssl.py", line 436, in export_encrypted_private_key_info_pem
    if gmssl.sm2_private_key_info_encrypt_to_pem(byref(self), c_char_p(passwd), c_void_p(fp)) != 1:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: exception: access violation writing 0x0000000000000024

在网上搜索该错误一直没找到解决办法,特在此提问,烦请进行解答,感谢

安装后在进行test时,和import时报错

import gmssl
Traceback (most recent call last):
File "", line 1, in
File "E:\crypto_lesson_java\PyQt_progress\GmSSL-Python-main\gmssl.py", line 18, in
gmssl = cdll.LoadLibrary(find_library("gmssl"))
File "E:\python3\lib\ctypes_init_.py", line 452, in LoadLibrary
return self.dlltype(name)
File "E:\python3\lib\ctypes_init
.py", line 374, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 不是有效的 Win32 应用程序。

安装后运行报错

Traceback (most recent call last):
File "C:\Users\sunqi\Desktop\GmSSL-Python-main\demo.py", line 2, in
from gmssl import *
File "C:\Users\sunqi\Desktop\GmSSL-Python-main\gmssl.py", line 18, in
gmssl = cdll.LoadLibrary(libgmssl)
File "C:\Users\sunqi\anaconda3\envs\win32py36sm9\lib\ctypes_init_.py", line 426, in LoadLibrary
return self.dlltype(name)
File "C:\Users\sunqi\anaconda3\envs\win32py36sm9\lib\ctypes_init
.py", line 348, in init
self._handle = _dlopen(self._name, mode)
TypeError: LoadLibrary() argument 1 must be str, not None

sm2样例运行报错

运行时报下面的错误:FileNotFoundError: Could not find module 'C:\Program Files\GmSSL 3.1.1\bin\gmssl.dll' (or one of its dependencies). Try using the full path with constructor syntax.

在控制台能够正常import:
image

Support SM9

Is there any plan to support sm9? if not, Can I contribute Pull requests?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.