You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: this function is duplicated in multisigTransactioSign.ts but as hardcoded. Replace that code later with this call (to avoid merge conflicts/duplication)
2
+
import{KmsClient}from'../../kms/kmsClient';
3
+
import{EnclavedConfig}from'../../types';
4
+
exportasyncfunctionretrieveKmsKey({
5
+
pub,
6
+
source,
7
+
cfg,
8
+
}: {
9
+
pub: string;
10
+
source: string;
11
+
cfg: EnclavedConfig;
12
+
}): Promise<string>{
13
+
constkms=newKmsClient(cfg);
14
+
// Retrieve the private key from KMS
15
+
letprv: string;
16
+
try{
17
+
constres=awaitkms.getKey({ pub, source });
18
+
prv=res.prv;
19
+
returnprv;
20
+
}catch(error: any){
21
+
throw{
22
+
status: error.status||500,
23
+
message: error.message||'Failed to retrieve key from KMS',
0 commit comments