From 8ce255a64b0940e92e647aa544bf5990b48279b7 Mon Sep 17 00:00:00 2001 From: "Lukas.J.Han" Date: Tue, 5 Mar 2024 00:33:27 +0900 Subject: [PATCH] feat: add jwk type (#130) Signed-off-by: Lukas.J.Han Signed-off-by: Mirko Mollik Co-authored-by: Mirko Mollik Signed-off-by: Mirko Mollik --- packages/core/src/test/index.spec.ts | 3 +-- packages/types/src/type.ts | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/core/src/test/index.spec.ts b/packages/core/src/test/index.spec.ts index ebf93430..d2b4ff89 100644 --- a/packages/core/src/test/index.spec.ts +++ b/packages/core/src/test/index.spec.ts @@ -1,9 +1,8 @@ import { SDJwtInstance, SdJwtPayload } from '../index'; -import { Signer, Verifier } from '@sd-jwt/types'; +import { Signer, Verifier, KbVerifier, JwtPayload } from '@sd-jwt/types'; import Crypto, { KeyLike } from 'node:crypto'; import { describe, expect, test } from 'vitest'; import { digest, generateSalt } from '@sd-jwt/crypto-nodejs'; -import { KbVerifier, JwtPayload } from '@sd-jwt/types'; import { importJWK, exportJWK, JWK } from 'jose'; export const createSignerVerifier = () => { diff --git a/packages/types/src/type.ts b/packages/types/src/type.ts index b5f3918b..10223dff 100644 --- a/packages/types/src/type.ts +++ b/packages/types/src/type.ts @@ -34,6 +34,27 @@ export type KBOptions = { payload: Omit; }; +interface JsonWebKey { + alg?: string; + crv?: string; + d?: string; + dp?: string; + dq?: string; + e?: string; + ext?: boolean; + k?: string; + key_ops?: string[]; + kty?: string; + n?: string; + oth?: RsaOtherPrimesInfo[]; + p?: string; + q?: string; + qi?: string; + use?: string; + x?: string; + y?: string; +} + export interface JwtPayload { cnf?: { jwk: JsonWebKey;