Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 python 的Cryptography 库从私钥获取公钥(也可以通过密码保护)。我怎样才能做到类似于 Python 的CryptoDome 库?
这应该适合你:
key_file = open('key.text', 'rb') private_key = serialization.load_pem_private_key( key_file.read(), password=None, backend=default_backend() ) public_key = private_key.public_key()