Accessing Public and Private Keys Programmatically in JS-IPFS

Hello, I was trying to access the IPFS public and private keys programmatically within JS-IPFS in Node. When I ran ipfs.key.list() however, I got the error of Error: Key management requires '--pass ...' option. I didn’t provide a password when the keys were generated, and moreover, I’m not even asking for access to the keys, just to list them. Has anyone else experienced this?

hello

do try into browser or into nodejs ?

if nodejs could share node version ?

Regards

I’m in node and my version is v8.11.2.

@daviddias did you have any idea about that into js-ipfs ?

Any idea about this?

Hi owenauch,

do you see and check this issue : https://github.com/ipfs/js-ipfs/issues/1135

Regards

I am using the IPFS node’s keypair to sign data like so:

myIPFSNode._peerInfo.id._privKey.sign(buffer, (err, signature) => { console.log(err, signature) callback(err, signature) })

Hope that helps!

  • David
1 Like