Skip to content

Commit

Permalink
fix: kid determination of a key should look for jwk thumbprint as well
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Jul 1, 2024
1 parent 5299044 commit d00e984
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/did-utils/src/did-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,13 @@ export async function getKey(
return identifierKey
}

/**
* Get the real kid as used in JWTs. This is the kid in the VM or in the JWT, not the kid in the Veramo/Sphereon keystore. That was just a poorly chosen name
* @param key
* @param idOpts
*/
export function determineKid(key: IKey, idOpts: IIdentifierOpts): string {
return key.meta?.verificationMethod?.id ?? idOpts.kid ?? key.kid
return key.meta?.verificationMethod?.id ?? key.meta?.jwkThumbprint ?? idOpts.kid ?? key.kid
}

export async function getSupportedDIDMethods(didOpts: IDIDOptions, context: IAgentContext<IDIDManager>) {
Expand Down

0 comments on commit d00e984

Please sign in to comment.