場景是使用python的python-rsa工具加載rsa公鑰時(shí)候異常
pyasn1.error.PyAsn1Error: TagSet(Tag(tagClass=0, tagFormat=32, tagId=16)) not in asn1Spec: {TagSet(Tag(tagClass=0, tagFormat=0, tagId=2)): Integer()}/{}
具體的報(bào)錯(cuò)信息是:

1、一種網(wǎng)絡(luò)的解決方案:
https://ask.helplib.com/others/post_5222242
他的方法是將加載RSA公鑰的函數(shù)進(jìn)行替代,從 public_key = rsa.PublicKey.load_pkcs1(ofile.read()) 替換成?public_key = rsa.PublicKey.load_pkcs1_openssl_pem(ofile.read()),如下圖所示

效果是加載字典中沒有報(bào)錯(cuò)了,但是監(jiān)控顯示公鑰加載失敗,并沒有解決問題
2、stackOverflow 上的解決方案
https://stackoverflow.com/questions/25243761/pyasn1-error-when-reading-a-pem-string
看的出來,和第一種是同種方法,甚至可能是同一個(gè)人提交的答案
但是在這里找到了文檔 Python-RSA 3.3 documentation【鏈接是 https://stuvel.eu/files/python-rsa-doc/reference.html】,其中有加載RSA公鑰的函數(shù)定義,如下所示:

3、Others
https://github.com/bidord/pykek/issues/1
4、查找到一篇博客,提到Python和Java跨平臺導(dǎo)致的RSA加密算法會有細(xì)微標(biāo)準(zhǔn)不同導(dǎo)致的加載失敗
https://www.cnblogs.com/skying555/p/6293751.html
改用 Cryptor-RSA 加密
參考:
http://blog.csdn.net/nyist327/article/details/48352253