-
Notifications
You must be signed in to change notification settings - Fork 18k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
proposal: crypto: add SignContext #28427
Comments
@gopherbot please add go2 |
Note that you can already use a curried function to achieve a similar effect: type CtxSigner = func(context.Context) crypto.Signer
func f(ctx context.Context, signCtx CtxSigner, […]) {
sig, err := signCtx(ctx).Sign(rand, digest, opts)
} That is, this may be more of an issue with the |
CC @FiloSottile |
Added to proposal minutes, but the motivation here is quite old. Is this still an ongoing concern for anyone? |
This proposal has been added to the active column of the proposals project |
Based on the discussion above, this proposal seems like a likely decline. |
No change in consensus, so declined. |
It is often desirable for a custom crypto.Signer implementation to get a hold of a context.Context during a signing operation, especially so if the signing involves HTTP or RPC roundtrips.
For example, one may want to use Google Cloud KMS to sign digests by implementing the
crypto.Signer
interface. This could then be fed to x/crypto/acme.Client where each request needs to be signed usingcrypto.Signer
.We already have precedents:
Please add
Go2
label.The text was updated successfully, but these errors were encountered: