美文网首页
rsatool.py 运行报错 pyasn1.error.PyA

rsatool.py 运行报错 pyasn1.error.PyA

作者: 狂风之息_ | 来源:发表于2020-10-14 20:26 被阅读0次

    生成私钥出错
    python rsatool.py -f PEM -o key.pem -n 87982816287542607821348020319142008042005562918106976160430773236821410039557 -d 25852344374158231210090465344549150080922879197607617242067940896729990939309

    报错:

    Traceback (most recent call last):
      File "rsatool.py", line 164, in <module>
        data = rsa.to_pem()
      File "rsatool.py", line 98, in to_pem
        return (PEM_TEMPLATE % base64.encodestring(self.to_der()).decode()).encode()
      File "rsatool.py", line 107, in to_der
        seq.setComponentByPosition(len(seq), Integer(x))
      File "/Users/dong/miniconda/envs/py2/lib/python2.7/site-packages/pyasn1-0.4.8-py2.7.egg/pyasn1/type/univ.py", line 2267, in __len__
      File "/Users/dong/miniconda/envs/py2/lib/python2.7/site-packages/pyasn1-0.4.8-py2.7.egg/pyasn1/type/base.py", line 214, in plug
    pyasn1.error.PyAsn1Error: Attempted "__len__" operation on ASN.1 schema object
    

    解决:

    pip uninstall pyasn1
    pip install pyasn1==0.4.5
    

    参考

    https://q.cnblogs.com/q/129227/

    相关文章

      网友评论

          本文标题:rsatool.py 运行报错 pyasn1.error.PyA

          本文链接:https://www.haomeiwen.com/subject/rvtgpktx.html