Saving DER as key.pem
Traceback (most recent call last):
File "rsatool.py", line 166, in <module>
data = rsa.to_der()
File "rsatool.py", line 107, in to_der
seq.setComponentByPosition(len(seq), Integer(x))
File "/usr/local/lib/python2.7/dist-packages/pyasn1-0.4.8-py2.7.egg/pyasn1/type/univ.py", line 2267, in len
return len(self._componentValues)
File "/usr/local/lib/python2.7/dist-packages/pyasn1-0.4.8-py2.7.egg/pyasn1/type/base.py", line 214, in plug
raise error.PyAsn1Error('Attempted "%s" operation on ASN.1 schema object' % name)
pyasn1.error.PyAsn1Error: Attempted "len" operation on ASN.1 schema object
您好,今天刚好也遇到相同的问题,依赖环境安装完成后rsatool.py运行后也出现Attempted "iter" operation on ASN.1 schema object错误。经过一段时间的搜索终于找到问题原因,根本原因是pyasn1库的bug(其他的开源项目中有人提过这个错误的issue),可采用的解决办法是降低pyasn1库版本来解决报错。
1.卸载已安装的pyasn1模块
pip uninstall pyasn1
2.安装低版本的pyasn1模块
pip install pyasn1==0.4.5
以上解决方法是解决了我的问题,希望也可以对您有所帮助。
问题已经解决,多谢大神,感谢感谢
感谢!今天碰到这个问题了