Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for new crypto/ecdh? #20

Closed
DeanPDX opened this issue Aug 7, 2023 · 1 comment
Closed

Support for new crypto/ecdh? #20

DeanPDX opened this issue Aug 7, 2023 · 1 comment
Labels
question Further information is requested

Comments

@DeanPDX
Copy link

DeanPDX commented Aug 7, 2023

I'm trying to update my API that uses acmez to use crypto/ecdh instead of crypto/elliptic. See this issue for more information about the rationale for deprecating crypto/elliptic. And this comment:

// Direct use of this package is deprecated, beyond the P224(), P256(), P384(),
// and P521() values necessary to use the crypto/ecdsa package. Most other uses
// should migrate to the more efficient and safer crypto/ecdh package.

The problem is: it doesn't implement signer so I can't use it for my PrivateKey in my acme.Account struct:

accountPrivateKey, err := ecdh.P256().GenerateKey(rand.Reader)
if err != nil {
	return resp, fmt.Errorf("generating account key: %v", err)
}
// Doesn't work because accountPrivateKey doesn't implement Signer
account := acme.Account{
	Contact:              []string{req.AccountContactEmailUrl},
	TermsOfServiceAgreed: true,
	PrivateKey:           accountPrivateKey,
}

Do you have any suggestions for this? Should I type alias it and implement Signer or something along those lines?

@mholt
Copy link
Owner

mholt commented Aug 8, 2023

ECDH doesn't provide authentication, so it can't sign content. The account private key has to sign content so it can protect payloads on your behalf.

Our examples show how to use ECDSA for this purpose, however. Hopefully that will help!

@mholt mholt closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2023
@mholt mholt added the question Further information is requested label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants