Skip to content

Commit

Permalink
Add sign method to handle signing requests in the API endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Inkvi committed Dec 5, 2024
1 parent a5ed3d3 commit cc8ff64
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ app.post('/', async (request, reply) => {
return;
case 'health_status':
return reply.code(200).send({result: 'ok'});
case 'sign':
const signature = await kmsProvider.signDigest(keyId, Buffer.from(params[0].slice(2), 'hex'));
return reply.code(200).send({result: signature.toString('hex')});
default:
reply.code(400).send({error: 'Method not supported'});
}
Expand Down

0 comments on commit cc8ff64

Please sign in to comment.