Sign in

Radar · Go · Archive · Week 10 · Mar 3 – 9, 2025

crypto: single‑shot signing interface

Worth knowingstdlib

What changed
A new MessageSigner interface was added to crypto. It extends Signer and introduces SignMessage. The helper SignMessage function attempts an interface upgrade to MessageSigner before falling back to Signer.Sign.
Production impact
The source does not say.
Try it
Use crypto.SignMessage with a key that implements MessageSigner (e.g., an ECDSA key) to sign a message in one call.
Source
github.com/golang/go/issues/63405

Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed