def _basic_rsa_signature(formatted, options):
private_key = serialization.load_pem_private_key(
options["privateKeyPem"],
password=None,
backend=default_backend())
signed = private_key.sign(
formatted,
# I'm guessing this is the right padding function...?
padding.PSS(
mgf=padding.MGF1(hashes.SHA256()),
salt_length=padding.PSS.MAX_LENGTH),
hashes.SHA256())
return base64.b64encode(signed).decode("utf-8")
评论列表
文章目录