Correctly generate and encode signatures.