ed25519: error when following docs to generate keypairs from seed.
var ed25519 = forge.pki.ed25519;
var password = 'Mai9ohgh6ahxee0jutheew0pungoozil';
var seed = new forge.util.ByteBuffer(password, 'utf8');
var keypair = ed25519.generateKeyPair({seed: seed}); // this will throw and error
the error is thrown from ed25519.generateKeyPair({seed: seed}); :
TypeError: "seed" must be a node.js Buffer, Uint8Array, or a binary string. at Object.ed25519.generateKeyPair (node_modules/node-forge/lib/ed25519.js:55:11)
in case someone still wants to use it, i used a simple node buffer and it works :
var seed = Buffer.from(password);
I guess a node buffer wont work on the browser.
I guess a node buffer wont work on the browser.
@Kreijstal you can try this, it may work: https://github.com/feross/buffer
@revoltez - you should use the https://github.com/digitalbazaar/ed25519-verification-key-2020#generating-a-new-publicprivate-key-pair library instead, don't use forge for this. (that lib works in both node and browser, and the DCC fork of it works in TypeScript and ReactNative).