Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Firefox Keystore - Parsing Certutil Output

by fixed_1978 (Initiate)
on Jun 10, 2014 at 16:32 UTC ( [id://1089423]=note: print w/replies, xml ) Need Help??


in reply to Re: Firefox Keystore - Parsing Certutil Output
in thread Firefox Keystore - Parsing Certutil Output

I did some more testing and found that the cert8.db file contains old certificate information even if the certificate is not in the certutil output. Additionally, not all of the possible certs start with CN=. So, my test was missing certs and setting certs that were not really in use. So I am back to doing a pattern match to extract the certificate information.

Now I parse through the certutil output and filter via the following:

foreach my $line (@certuil_output) { my $cert; my $trust; if ($line =~ /(^$|SSL,S\/MIME,JAR\/XPI|Certificate Nickname)/i) { +next; } if ($line =~ /(.*)\s+(\w+,\w+,\w+)$/) { $cert = $1; $trust = $2 } elsif ($line =~ /(.*)\s+,,\s+$/) { $cert = $1; $trust = “,,”; } else { print “Unmatched line: $line\n”; } if ($cert && $trust) { print "$cert\t$trust\n"; } }

So unless there is a better way, this is what I have.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1089423]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-18 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found