certutil should return:
================ Certificate 0 ================
================ Begin Nesting Level 1 ================
Element 0:
Serial Number: 69cb5854cd86319c481d974e15339221
Issuer: CN=where
NotBefore: 2021/10/10 21:16
NotAfter: 2031/10/10 21:26
Subject: CN=where
Signature matches Public Key
Root Certificate: Subject matches Issuer
Cert Hash(sha1): 0cdf4a03e9be9dd789894bb3c7ad3dedecd9ab25
---------------- End Nesting Level 1 ----------------
Provider = Microsoft Software Key Storage Provider
Private key is NOT plain text exportable
Encryption test passed
CertUtil: -dump command completed successfully.
But it return:
================ ֤�� 0 ================
================ ��ʼǶ�ȼ� 1 ================
Ԫ�� 0:
���к�: 69cb5854cd86319c481d974e15339221
�䷢��: CN=where
NotBefore: 2021/10/10 21:16
NotAfter: 2031/10/10 21:26
ʹ����: CN=where
ǩ���빫Կƥ��
��֤��: ʹ������䷢��ƥ��
֤���ϣ(sha1): 0cdf4a03e9be9dd789894bb3c7ad3dedecd9ab25
---------------- ����Ƕ�ȼ� 1 ----------------
�ṩ���� = Microsoft Software Key Storage Provider
���Դ��ı���ʽ����˽Կ
ͨ���˼��ܲ���
CertUtil: -dump ����ɹ���ɡ�
Which cause error: Unable to find publisher in Cert.
|
export const getCertPublisher = async (cert: string, cert_pass: string) => { |
|
const args = []; |
|
args.push('-p', cert_pass); |
|
args.push('-dump', cert); |
|
const certDump = await run('certutil', args); |
|
const subjectRegex = /Subject:\s*(.*)/; |
|
const match = certDump.match(subjectRegex); |
|
const publisher = match ? match[1].trim() : null; |
|
if(!publisher) { |
|
log.error('Unable to find publisher in Cert'); |
|
} |
|
return publisher; |
|
} |
certutilshould return:But it return:
Which cause
error: Unable to find publisher in Cert.electron-windows-msix/src/bin.ts
Lines 55 to 67 in 37f9d31