Update certificate chain handling

This commit is contained in:
Tuan Dang
2024-06-09 23:23:01 -04:00
parent b6c924ef37
commit b48325b4ba
9 changed files with 56 additions and 66 deletions
@@ -78,7 +78,7 @@ export const certificateAuthorityQueueFactory = ({
const ca = await certificateAuthorityDAL.findById(caId);
if (!ca) throw new BadRequestError({ message: "CA not found" });
const caKeys = await certificateAuthoritySecretDAL.findOne({ caId: ca.id });
const caSecret = await certificateAuthoritySecretDAL.findOne({ caId: ca.id });
const alg = keyAlgorithmToAlgCfg(ca.keyAlgorithm as CertKeyAlgorithm);
@@ -90,7 +90,7 @@ export const certificateAuthorityQueueFactory = ({
const privateKey = await kmsService.decrypt({
kmsId: keyId,
cipherTextBlob: caKeys.encryptedPrivateKey
cipherTextBlob: caSecret.encryptedPrivateKey
});
const skObj = crypto.createPrivateKey({ key: privateKey, format: "der", type: "pkcs8" });