Skip to content

Commit

Permalink
always output cerificate validity
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Feb 13, 2024
1 parent 500ce4f commit 9f19f5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ async function addCertificateToStore(){
if (password == ''){
throw new Error("Required Password to store certificate is an empty string");
}
var infoCommand = `certutil -dump -p ${password} $certificateFileName | findstr /c:" Not After: "`
var command = `certutil -f -p ${password} -importpfx ${certificateFileName}`
try {
var infoStdOut = (await asyncExec(infoCommand)).stdout;
console.log(`Certificate valid until ${infoStdOut.trim().split(' ')[1]}`);
const { stdout } = await asyncExec(command);
console.log(stdout);
} catch( err) {
Expand Down

0 comments on commit 9f19f5f

Please sign in to comment.