microsoft / VerifiableCredentials-Verification-SDK-Typescript

An SDK to help Relying Parties manages their Decentralized Identities and Verifiable Credentials.
MIT License
53 stars 14 forks source link

Change that requires the update key is failing with "key: Is not extractable" #115

Open maakle opened 3 years ago

maakle commented 3 years ago

I saw that you recently changed that we need to include an update key.

I implemented it like you suggested:

let crypto: Crypto;
(async () => {
  try {
    crypto = await createIssuerCrypto();
    crypto = await crypto.generateKey(KeyUse.Signature, "signing");
    crypto = await crypto.generateKey(KeyUse.Signature, "recovery");
    crypto = await crypto.generateKey(KeyUse.Signature, "update");    
    const did = await new LongFormDid(crypto).serialize();
    crypto.builder.useUpdateKeyReference(crypto.builder.updateKeyReference);
    crypto.builder.useDid(did);
  } catch (error) {
    console.log(error);
  }
})();

Though the line where I generate the update key fails with the following message: (node:52954) UnhandledPromiseRejectionWarning: Error: key: Is not extractable at EcdsaProvider.checkExportKey

Are you aware of this or am I missing something? Would also be cool if you could update the demo App that shows the right approach.