Open wip-abramson opened 1 year ago
@wip-abramson Can you say more about "it no longer appears to do this"? Looking at the current code, it's still returning the keypair (this line here https://github.com/digitalbazaar/did-method-key/blob/main/lib/DidKeyDriver.js#L70C7-L70C36 )
What behavior are you encountering? (Give us reproduce steps.)
Apologies. I did misread the code, although i still am not getting expected results.
Here is my code
const didKeyDriver2018 = driver();
didKeyDriver2018.use({
multibaseMultikeyHeader: 'z6Mk',
fromMultibase: createFromMultibase(Ed25519VerificationKey2018)
});
const edKeyPair = await Ed25519VerificationKey2018.generate();
const {didDocument, keyPairs, methodFor} = await didKeyDriver2018.fromKeyPair({
verificationKeyPair: edKeyPair
});
let methodKeyPair = methodFor({purpose: 'authentication', privateKey:true});
console.log("method privkey", methodKeyPair.privateKeyBase58); // is null
console.log("keypair privkey", edKeyPair.privateKeyBase58); // is a private key
Probably I am just doing something wrong.
@wip-abramson Thanks. Yeah, this seems to be a bug in the newer code.
The _keyPairToDidDocument
method here only converts the public key, but not the private key.
/cc @davidlehn
Previously when I used this library the
methodFor
function would act as aIt no longer appears to do this.
Is there now a different way to use this library to get the requisite private keys (with id and controller) required for the vc.js library?