I am trying to generate a credential using the didkit-wasm library with the following code, but getting error with prepareIssueCredential
method: key expansion failed
.
Any idea what i could be doing wrong
const did = `did:pkh:tz:` + userData.account.address;
const credential = {
'@context': [
'https://www.w3.org/2018/credentials/v1',
{
alias: 'https://schema.org/name',
description: 'https://schema.org/description',
website: 'https://schema.org/url',
logo: 'https://schema.org/logo',
BasicProfile: 'https://tzprofiles.com/BasicProfile',
},
],
id: 'urn:uuid:' + uuid(),
issuer: 'did:pkh:tz:tz1ZDSnw...',
issuanceDate: new Date().toISOString(),
type: ['VerifiableCredential', 'Company Credential'],
credentialSubject: {
id: did,
name: company.name,
description: company.description,
url: company.url,
},
};
let credentialString = JSON.stringify(credential);
const proofOptions = {
verificationMethod: did + '#TezosMethod2021', //subject's did
proofPurpose: 'assertionMethod',
};
const publicKeyJwkString = await JWKFromTezos(
'edpkuGHxcJDq9....' //issuer's public key
);
let prepStr = await prepareIssueCredential(
credentialString,
JSON.stringify(proofOptions),
publicKeyJwkString
);