fix: support passphrase env var

This commit is contained in:
Mythie
2023-05-27 01:31:48 +10:00
parent 0564792604
commit de46d0f4ab
2 changed files with 2 additions and 1 deletions

View File

@ -18,6 +18,7 @@ NEXTAUTH_URL='http://localhost:3000'
# SIGNING
CERT_FILE_PATH=
CERT_PASSPHRASE=
# MAIL (NODEMAILER)
# SENDGRID

View File

@ -61,7 +61,7 @@ export const addDigitalSignature = async (documentAsBase64: string): Promise<str
const signObj = new signer.SignPdf();
const signedPdfBuffer: Buffer = signObj.sign(modifiedPdfBuffer, p12Buffer, {
passphrase: "",
passphrase: process.env.CERT_PASSPHRASE || "",
});
return signedPdfBuffer.toString("base64");