Skip to content

Commit

Permalink
feat: add jwk type (openwallet-foundation#130)
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas.J.Han <lukas.j.han@gmail.com>
Signed-off-by: Mirko Mollik <mirko.mollik@fit.fraunhofer.de>
Co-authored-by: Mirko Mollik <mirko.mollik@fit.fraunhofer.de>
Signed-off-by: Mirko Mollik <mirko.mollik@fit.fraunhofer.de>
  • Loading branch information
lukasjhan and cre8 committed Mar 8, 2024
1 parent c335b8d commit 9291a44
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/core/src/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -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 = () => {
Expand Down
21 changes: 21 additions & 0 deletions packages/types/src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@ export type KBOptions = {
payload: Omit<kbPayload, 'sd_hash'>;
};

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;
Expand Down

0 comments on commit 9291a44

Please sign in to comment.