diff --git a/src/interfaces/index.ts b/src/interfaces/index.ts index 10280255..db7eed00 100644 --- a/src/interfaces/index.ts +++ b/src/interfaces/index.ts @@ -1,7 +1,37 @@ -export * from "./claims"; -export * from "./claims-result"; -export * from "./common"; +export type { + // From common.ts + GenericCredWrapper, + GenericVerifiableCredential, + KeyMeta, + // Exclude types that are also exported from other files + // GiveVerifiableCredential, + // OfferVerifiableCredential, + // RegisterVerifiableCredential, + // PlanSummaryRecord, + // UserInfo, +} from "./common"; + +export type { + // From claims.ts + GiveVerifiableCredential, + OfferVerifiableCredential, + RegisterVerifiableCredential, +} from "./claims"; + +export type { + // From claims-result.ts + CreateAndSubmitClaimResult, +} from "./claims-result"; + +export type { + // From records.ts + PlanSummaryRecord, +} from "./records"; + +export type { + // From user.ts + UserInfo, +} from "./user"; + export * from "./limits"; -export * from "./records"; -export * from "./user"; export * from "./deepLinks"; diff --git a/src/libs/crypto/vc/passkeyDidPeer.ts b/src/libs/crypto/vc/passkeyDidPeer.ts index 5f64f490..0728baa4 100644 --- a/src/libs/crypto/vc/passkeyDidPeer.ts +++ b/src/libs/crypto/vc/passkeyDidPeer.ts @@ -1,7 +1,5 @@ import { Buffer } from "buffer/"; import { JWTPayload } from "did-jwt"; -import { DIDResolutionResult } from "did-resolver"; -import { sha256 } from "ethereum-cryptography/sha256.js"; import { p256 } from "@noble/curves/p256"; import { startAuthentication, @@ -318,15 +316,12 @@ export async function createDidPeerJwt( // ... and this import: // import { p256 } from "@noble/curves/p256"; export async function verifyJwtP256( - credIdHex: string, issuerDid: string, authenticatorData: ArrayBuffer, challenge: Uint8Array, - clientDataJsonBase64Url: Base64URLString, signature: Base64URLString, ) { const authDataFromBase = Buffer.from(authenticatorData); - const clientDataFromBase = Buffer.from(clientDataJsonBase64Url, "base64"); const sigBuffer = Buffer.from(signature, "base64"); const finalSigBuffer = unwrapEC2Signature(sigBuffer); const publicKeyBytes = peerDidToPublicKeyBytes(issuerDid); @@ -386,15 +381,12 @@ export async function verifyJwtSimplewebauthn( // similar code is in endorser-ch util-crypto.ts verifyPeerSignature export async function verifyJwtWebCrypto( - credId: Base64URLString, issuerDid: string, authenticatorData: ArrayBuffer, challenge: Uint8Array, - clientDataJsonBase64Url: Base64URLString, signature: Base64URLString, ) { const authDataFromBase = Buffer.from(authenticatorData); - const clientDataFromBase = Buffer.from(clientDataJsonBase64Url, "base64"); const sigBuffer = Buffer.from(signature, "base64"); const finalSigBuffer = unwrapEC2Signature(sigBuffer);