From 965053b583ad5565fdefe3ebeaf16646bb8eba48 Mon Sep 17 00:00:00 2001 From: Beeram Rahul Reddy Date: Wed, 18 Sep 2024 20:36:07 +0530 Subject: [PATCH] made changes --- src/actions/pvtKeyEncryptMgmt.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/actions/pvtKeyEncryptMgmt.ts b/src/actions/pvtKeyEncryptMgmt.ts index eeca992..d30d9f8 100644 --- a/src/actions/pvtKeyEncryptMgmt.ts +++ b/src/actions/pvtKeyEncryptMgmt.ts @@ -3,6 +3,7 @@ import prisma from '@/db' import { authOptions } from '@/lib/auth' import { aesEncrypt } from '@/services/aes-module' +import { awsEncrypt } from '@/services/aws-kms-module' import { splitSecret } from '@/services/keyShardingService' import { getServerSession } from 'next-auth' @@ -15,7 +16,11 @@ export async function pvtKeyEncryptionManager(privateKey: string) { //AES Share 1 -> share encryption AES module const aesEncryptedShare = aesEncrypt(aesShareString) - //AWS Share 2 -> share encryption AWS module + //AWS Share 2 -> share encryption AWS module + const awsEncryptedShare = await awsEncrypt(awsShareString, { + purpose: "tiplink", + country: "India" + }); //GCP Share 3 -> share encryption GCP module @@ -27,7 +32,7 @@ export async function pvtKeyEncryptionManager(privateKey: string) { }, data: { aesShare: aesEncryptedShare, + awsShare: awsEncryptedShare }, }) - console.log(response) }