我在码头的Ubuntu 18.04上有这个问题。当我在macOS上开发这个应用程序时,没有这样的错误。
我使用以下Dockerfile构建映像:https://pastebin.com/rG32a0dv
requirements.txt:
Flask==1.0.2
uWSGI==2.0.17.1
Authlib==0.10
cryptography==2.3.1
代码中的用法:
header = {'alg': 'RS256'}
payload = {'login': login}
auth_token = jwt.encode(header, payload, private_key)
和
try:
claims = jwt.decode(auth_token, public_key)
except BadSignatureError:
return False
整个酒瓶应用程序:https://pastebin.com/9vVJQL1w
我有个错误:
authlib.specs.rfc7515.errors.UnsupportedAlgorithmError: unsupported_algorithm:
详细信息:https://pastebin.com/MjFRce1F
为什么会出现此错误?我能做些什么来解决这个问题?
发布于 2018-10-28 16:23:17
密码学没有用于manylinux
3.7的CPython车轮。在这种情况下,您需要自己在linux上构建密码学。请参阅下列文件:
https://cryptography.io/en/latest/installation/#building-cryptography-on-linux
您可以尝试导入一些加密模块来验证:
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric.utils import (
decode_dss_signature, encode_dss_signature
)
from cryptography.hazmat.primitives.asymmetric.ec import ECDSA
from cryptography.hazmat.primitives.asymmetric import padding
https://stackoverflow.com/questions/53029595
复制