Skip to content

Commit

Permalink
fix: support publicKeyJwk when comparing blockchainAccountId (#1194)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyv09 authored Jul 3, 2023
1 parent 78b4bfb commit 9110688
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/utils/src/did-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ export function compressIdentifierSecp256k1Keys(identifier: IIdentifier): IKey[]
*/
function compareBlockchainAccountId(localKey: IKey, verificationMethod: VerificationMethod): boolean {
if (
(verificationMethod.type !== 'EcdsaSecp256k1RecoveryMethod2020' &&
verificationMethod.type !== 'EcdsaSecp256k1VerificationKey2019') ||
localKey.type !== 'Secp256k1'
!(
verificationMethod.type === 'EcdsaSecp256k1RecoveryMethod2020' ||
verificationMethod.type === 'EcdsaSecp256k1VerificationKey2019' ||
(verificationMethod.type === 'JsonWebKey2020' &&
verificationMethod.publicKeyJwk &&
verificationMethod.publicKeyJwk.crv === 'secp256k1') ||
localKey.type === 'Secp256k1'
)
) {
return false
}
Expand Down

0 comments on commit 9110688

Please sign in to comment.