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

eddsa.GenerateKey uses internal parameter #176

Open
Alkorin opened this issue Jul 6, 2023 · 2 comments
Open

eddsa.GenerateKey uses internal parameter #176

Alkorin opened this issue Jul 6, 2023 · 2 comments

Comments

@Alkorin
Copy link

Alkorin commented Jul 6, 2023

I try to generate a private Ed25519 Key, but eddsa.GenerateKey expects an ecc.EdDSACurve and NewEd25519 is inside an internal package :/

Is there a way to generate a private Ed25519 Key like in

eddsaPriv, err := eddsa.GenerateKey(rand.Reader, ecc.NewEd25519())
?

@lubux
Copy link
Contributor

lubux commented Jul 7, 2023

Hi 👋 Thanks for pointing this out.
It is possible to generate an Ed25519 PGP key as follows:

config := &packet.Config{
	Algorithm: packet.PubKeyAlgoEdDSA,
}
entity, err := openpgp.NewEntity("test", "", "[email protected]", config)

The primary private key entity.PrivateKey is an Ed25519 private key.

@smlx
Copy link

smlx commented Jul 18, 2023

This PR solves a similar issue: #157

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

No branches or pull requests

3 participants