def key_sign(rsakey, message, digest):
    """Sign the given message with the RSA key."""
    padding = _asymmetric.padding.PKCS1v15()
    signature = rsakey.sign(message, padding, digest)
    return signature
Sign the given message with the RSA key.