From 17d51354d736b15040211ef2280c4620ab2d193b Mon Sep 17 00:00:00 2001 From: Mythie Date: Sun, 28 May 2023 00:39:07 +1000 Subject: [PATCH] fix: support cert file encodings --- .env.example | 1 + packages/signing/addDigitalSignature.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index f9ddba801..a1faef3f0 100644 --- a/.env.example +++ b/.env.example @@ -19,6 +19,7 @@ NEXTAUTH_URL='http://localhost:3000' # SIGNING CERT_FILE_PATH= CERT_PASSPHRASE= +CERT_FILE_ENCODING= # MAIL (NODEMAILER) # SENDGRID diff --git a/packages/signing/addDigitalSignature.ts b/packages/signing/addDigitalSignature.ts index 98e25879e..6f191ceda 100644 --- a/packages/signing/addDigitalSignature.ts +++ b/packages/signing/addDigitalSignature.ts @@ -1,7 +1,7 @@ import { PDFDocument, PDFHexString, PDFName, PDFNumber, PDFString } from "pdf-lib"; -const fs = require("fs"); +import fs from "fs"; // Local copy of Node SignPDF because https://github.com/vbuch/node-signpdf/pull/187 was not published in NPM yet. Can be switched to npm packge. const signer = require("./node-signpdf/dist/signpdf"); @@ -9,7 +9,9 @@ export const addDigitalSignature = async (documentAsBase64: string): Promise