Sign then Encrypt

Just as a heads up this is wacky as shit because of some weird merging and rebasing…I'm still looking at it but if you see anything odd please let me know.
Since #817 is not your PR and nobody's assigned to it, anyone except @gubatron can merge it if they deem it ready.