生成私钥出错
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
参考
网友评论