{"action":"created","issue":{"url":"https://api.github.com/repos/pyca/cryptography/issues/1648","repository_url":"https://api.github.com/repos/pyca/cryptography","labels_url":"https://api.github.com/repos/pyca/cryptography/issues/1648/labels{/name}","comments_url":"https://api.github.com/repos/pyca/cryptography/issues/1648/comments","events_url":"https://api.github.com/repos/pyca/cryptography/issues/1648/events","html_url":"https://github.com/pyca/cryptography/issues/1648","id":56668718,"number":1648,"title":"API request: decouple hashing process from signature generation / verification","user":{"login":"catlee","id":54458,"avatar_url":"https://avatars.githubusercontent.com/u/54458?v=3","gravatar_id":"","url":"https://api.github.com/users/catlee","html_url":"https://github.com/catlee","followers_url":"https://api.github.com/users/catlee/followers","following_url":"https://api.github.com/users/catlee/following{/other_user}","gists_url":"https://api.github.com/users/catlee/gists{/gist_id}","starred_url":"https://api.github.com/users/catlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catlee/subscriptions","organizations_url":"https://api.github.com/users/catlee/orgs","repos_url":"https://api.github.com/users/catlee/repos","events_url":"https://api.github.com/users/catlee/events{/privacy}","received_events_url":"https://api.github.com/users/catlee/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/pyca/cryptography/milestones/18","html_url":"https://github.com/pyca/cryptography/milestones/Sixteenth%20Release","labels_url":"https://api.github.com/repos/pyca/cryptography/milestones/18/labels","id":1964815,"number":18,"title":"Sixteenth Release","description":"","creator":{"login":"reaperhulk","id":161495,"avatar_url":"https://avatars.githubusercontent.com/u/161495?v=3","gravatar_id":"","url":"https://api.github.com/users/reaperhulk","html_url":"https://github.com/reaperhulk","followers_url":"https://api.github.com/users/reaperhulk/followers","following_url":"https://api.github.com/users/reaperhulk/following{/other_user}","gists_url":"https://api.github.com/users/reaperhulk/gists{/gist_id}","starred_url":"https://api.github.com/users/reaperhulk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reaperhulk/subscriptions","organizations_url":"https://api.github.com/users/reaperhulk/orgs","repos_url":"https://api.github.com/users/reaperhulk/repos","events_url":"https://api.github.com/users/reaperhulk/events{/privacy}","received_events_url":"https://api.github.com/users/reaperhulk/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":25,"state":"open","created_at":"2016-08-26T10:16:33Z","updated_at":"2016-11-20T23:55:37Z","due_on":null,"closed_at":null},"comments":37,"created_at":"2015-02-05T13:17:28Z","updated_at":"2016-11-20T23:55:37Z","closed_at":"2016-11-20T23:55:37Z","body":"Currently to sign or verify a signature you need the entire message data and key in the same place so you can create the signer or verifier object. e.g. from the docs:\n\n``` python\n>>> signer = private_key.signer(\n...     padding.PSS(\n...         mgf=padding.MGF1(hashes.SHA256()),\n...         salt_length=padding.PSS.MAX_LENGTH\n...     ),\n...     hashes.SHA256()\n... )\n>>> message = b\"A message I want to sign\"\n>>> signer.update(message)\n>>> signature = signer.finalize()\n```\n\nI'd like to be able to decouple this process so that I generate the hash of the message in one place, and then sign it in another place. So something like this:\n\n``` python\n>>> message = b\"A message I want to sign\"\n>>> hasher = hashes.SHA256()\n>>> hasher.update(message)\n>>> digest = hasher.digest()\n\n# Elsewhere....\n\n>>> signer = private_key.signer(\n...     padding.PSS(\n...         mgf=padding.MGF1(hashes.SHA256()),\n...         salt_length=padding.PSS.MAX_LENGTH\n...     ),\n...     hashes.SHA256()\n... )\n>>> signature = signer.sign_digest(digest)\n```\n"},"comment":{"url":"https://api.github.com/repos/pyca/cryptography/issues/comments/261816300","html_url":"https://github.com/pyca/cryptography/issues/1648#issuecomment-261816300","issue_url":"https://api.github.com/repos/pyca/cryptography/issues/1648","id":261816300,"user":{"login":"alex","id":772,"avatar_url":"https://avatars.githubusercontent.com/u/772?v=3","gravatar_id":"","url":"https://api.github.com/users/alex","html_url":"https://github.com/alex","followers_url":"https://api.github.com/users/alex/followers","following_url":"https://api.github.com/users/alex/following{/other_user}","gists_url":"https://api.github.com/users/alex/gists{/gist_id}","starred_url":"https://api.github.com/users/alex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex/subscriptions","organizations_url":"https://api.github.com/users/alex/orgs","repos_url":"https://api.github.com/users/alex/repos","events_url":"https://api.github.com/users/alex/events{/privacy}","received_events_url":"https://api.github.com/users/alex/received_events","type":"User","site_admin":false},"created_at":"2016-11-20T23:55:37Z","updated_at":"2016-11-20T23:55:37Z","body":"done!"}}
{"actor":{"display_login":"alex"}}