From 46e0b35f77ab5d120cd668e5715048764b1785bd Mon Sep 17 00:00:00 2001 From: Ajitomi Daisuke Date: Wed, 6 Nov 2024 19:17:16 +0900 Subject: [PATCH] Add JsonWebKeyExtended interface for AKP. --- packages/common/mod.ts | 1 + packages/common/src/interfaces/jsonWebKeyExtended.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 packages/common/src/interfaces/jsonWebKeyExtended.ts diff --git a/packages/common/mod.ts b/packages/common/mod.ts index 8f57c914b..4aec0b575 100644 --- a/packages/common/mod.ts +++ b/packages/common/mod.ts @@ -2,6 +2,7 @@ export type { AeadEncryptionContext } from "./src/interfaces/aeadEncryptionConte export type { AeadInterface } from "./src/interfaces/aeadInterface.ts"; export type { DhkemPrimitives } from "./src/interfaces/dhkemPrimitives.ts"; export type { DhkemInterface } from "./src/interfaces/dhkemInterface.ts"; +export type { JsonWebKeyExtended } from "./src/interfaces/jsonWebKeyExtended.ts"; export type { KdfInterface } from "./src/interfaces/kdfInterface.ts"; export type { KemInterface } from "./src/interfaces/kemInterface.ts"; export type { KeyScheduleParams } from "./src/interfaces/keyScheduleParams.ts"; diff --git a/packages/common/src/interfaces/jsonWebKeyExtended.ts b/packages/common/src/interfaces/jsonWebKeyExtended.ts new file mode 100644 index 000000000..de924fc4b --- /dev/null +++ b/packages/common/src/interfaces/jsonWebKeyExtended.ts @@ -0,0 +1,12 @@ +/** + * Extended JsonWebKey interface to support `pub` and `priv` properties, + * which are not supported by the current `JsonWebKey`. + * Both of them are defined for the newly defined JSON WWb Key type AKP (Algorithm Key Pair), + * which is used to express Public and Private Keys for use with Algorithms. + */ +export interface JsonWebKeyExtended extends JsonWebKey { + /** The public key in base64url encoding, which is used with the 'AKP' key type. */ + pub?: string; + /** The private key in base64url encoding, which is used with the 'AKP' key type. */ + priv?: string; +}