diff --git a/backend/src/identity/utils.ts b/backend/src/identity/utils.ts index a562071..de537b7 100644 --- a/backend/src/identity/utils.ts +++ b/backend/src/identity/utils.ts @@ -15,6 +15,8 @@ export interface DataSigningRequest { data: Uint8Array; /** Signing key's ID. */ keyId: string; + /** Key type of the key with id `key_id`. Valid values are: Ed25519, ES256, ES256K. */ + keyType: string; } export interface DataSigningResponse { diff --git a/oid4vc/TangleLabs/src/remoteSigner.ts b/oid4vc/TangleLabs/src/remoteSigner.ts index 5626a6d..bfc0e06 100644 --- a/oid4vc/TangleLabs/src/remoteSigner.ts +++ b/oid4vc/TangleLabs/src/remoteSigner.ts @@ -4,6 +4,7 @@ import { dirname } from 'path'; import * as grpc from "@grpc/grpc-js"; import { loadSync } from "@grpc/proto-loader"; import { Signer } from 'did-jwt'; +import { KeyType } from "@sphereon/did-resolver-jwk"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); @@ -28,6 +29,7 @@ export const remoteSigner: (keyId: string) => Signer = (keyId) => async (data) = const response = await new Promise((resolve, reject) => identityClient.sign({ keyId, + keyType: "ES256", data: Uint8Array.from(Buffer.from(data)), }, (err, response) => { if (err) { diff --git a/shared/proto/identity/utils.proto b/shared/proto/identity/utils.proto index 80f0692..25b83df 100644 --- a/shared/proto/identity/utils.proto +++ b/shared/proto/identity/utils.proto @@ -9,6 +9,8 @@ message DataSigningRequest { bytes data = 1; // Signing key's ID. string key_id = 2; + // Key type of the key with id `key_id`. Valid values are: Ed25519, ES256, ES256K. + string key_type = 3; } message DataSigningResponse { diff --git a/tooling/API/Identity/GRPC.http b/tooling/API/Identity/GRPC.http index b6dad2f..aad849c 100644 --- a/tooling/API/Identity/GRPC.http +++ b/tooling/API/Identity/GRPC.http @@ -53,7 +53,8 @@ GRPC /Jwt/create GRPC /Signing/sign { "data": {{data}}, - "keyId": "pK0JAYw5RFFKqorBn0x4w98zl2UBfRys" + "keyId": "UUMXMjmLiKKUChyHGRjiEdSVTSUDSMTD", + "keyType": "ES256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