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

EcdsaKeyPair from private key component only? #882

Open
partim opened this issue Jul 30, 2019 · 2 comments · May be fixed by #889
Open

EcdsaKeyPair from private key component only? #882

partim opened this issue Jul 30, 2019 · 2 comments · May be fixed by #889

Comments

@partim
Copy link

partim commented Jul 30, 2019

Would you consider adding a function similar to Ed25519KeyPair::from_seed_unchecked?

Background is that in DNSSEC, existing implementations (bind, ldns) store keys in files with a special format. For ECDSA, these files only contain the private key component. Technically, there is also an accompanying files with the DNSKEY record containing the public key, but for robustness, I would prefer ignoring that and generating the record from the key pair only.

@briansmith
Copy link
Owner

Yes, I'll take it, provided the PR has full test coverage of the new code.

Note, however, that the API was specifically designed to discourage you from doing it that way. IMO, if you load a public key from one file, and a private key from another file, and they don't agree, then you really shouldn't use that private key. Just as one example, consider the case where the user restored one of the files from backup but not the other, so that they're accidentally out of sync; the current API would help you catch that kind of mistake.

@partim
Copy link
Author

partim commented Aug 19, 2019

I agree that the current API is preferable and more robust in most use cases. DNSSEC seems to be an exception and I think it is more robust to only keep the private key and any time you update the DNSKEY record, regenerate it from scratch.

I will provide a PR and make sure to add a warning to the documentation of the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants