Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Firefox Keystore - Parsing Certutil Outputby fixed_1978 (Initiate) |
on Jun 06, 2014 at 17:35 UTC ( [id://1089081]=perlquestion: print w/replies, xml ) | Need Help?? |
fixed_1978 has asked for the wisdom of the Perl Monks concerning the following question: Perl Monks, I am working on a project and need to parse the content's of a user's firefox keystore. My current method is to use the certutil command to generate the output and look for matching lines. e.g.
In my script I basically do something like:
This works, but I am not happy with it. For this to work, I need to know the certificate name in advance or at least the pattern to do actual work on it and I never capture the certificate name. I would like to be able to dynamically capture the CN and trust level as separate values and place them in a hash. For example:
No clean break exists between the certficate name and the trust level in the certutil output. Additionally, the certificate name is not a fixed length, may or may not have spaces, and may have a different path structures depending. In short, my questions are: - Is certutil the only way to get the certificate data from firefox's db files or is there a more Perl way to do it? - If certutil is my only option, is there a clean way to extract the certificate name and the trust level? Thanks in advance,
Back to
Seekers of Perl Wisdom
|
|