mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 19:25:23 +00:00
Improved passphrase extraction
This commit is contained in:
@@ -270,13 +270,12 @@ export async function readCertificatesFromOptions(options: Certificates): Promis
|
|||||||
const parsedContents = await Promise.all(rawContentsPromises);
|
const parsedContents = await Promise.all(rawContentsPromises);
|
||||||
const pemParsedContents = parsedContents.map((file, index) => {
|
const pemParsedContents = parsedContents.map((file, index) => {
|
||||||
const certName = Object.keys(options)[index];
|
const certName = Object.keys(options)[index];
|
||||||
const pem = parsePEM(
|
const passphrase = (
|
||||||
certName,
|
typeof options.signerKey === "object" &&
|
||||||
file,
|
options.signerKey?.passphrase
|
||||||
typeof options.signerKey === "object"
|
) || undefined;
|
||||||
? options.signerKey.passphrase
|
|
||||||
: undefined
|
const pem = parsePEM(certName, file, passphrase);
|
||||||
);
|
|
||||||
|
|
||||||
if (!pem) {
|
if (!pem) {
|
||||||
throw new Error(formatMessage("INVALID_CERTS", certName));
|
throw new Error(formatMessage("INVALID_CERTS", certName));
|
||||||
|
|||||||
Reference in New Issue
Block a user