diff options
author | Matthew Miller <matthew@millerti.me> | 2022-11-16 13:40:51 -0800 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2022-11-16 13:40:51 -0800 |
commit | e1ff1e0317727e0aee28f81da36b6bc8e8bc606c (patch) | |
tree | 9d6bc6056a5636705ec48b5ab227c838127985a2 | |
parent | 41fffae2ee4676e5905ca86b8f5d813702c70693 (diff) |
Make new isoVerify default sig verifier for pubkey
-rw-r--r-- | packages/server/src/helpers/verifySignature.ts | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/packages/server/src/helpers/verifySignature.ts b/packages/server/src/helpers/verifySignature.ts index f9eb747..a2a54dc 100644 --- a/packages/server/src/helpers/verifySignature.ts +++ b/packages/server/src/helpers/verifySignature.ts @@ -3,7 +3,6 @@ import { verify as ed25519Verify } from '@noble/ed25519'; import { COSEKEYS, COSEKTY, COSEPublicKey } from './convertCOSEtoPKCS'; import { convertCertBufferToPEM } from './convertCertBufferToPEM'; -import { convertPublicKeyToPEM } from './convertPublicKeyToPEM'; import { isoCBOR, isoCrypto } from './iso'; type VerifySignatureOptsLeafCert = { @@ -73,11 +72,8 @@ export async function verifySignature( } return ed25519Verify(signature, signatureBase, (x as Uint8Array)); - } else if (kty === COSEKTY.EC2) { - return isoCrypto.verify(cosePublicKey, signature, signatureBase); } else { - // Convert pubKey to PEM for ECC and RSA - publicKeyPEM = convertPublicKeyToPEM(credentialPublicKey); + return isoCrypto.verify(cosePublicKey, signature, signatureBase); } } |