Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to build complete certificate name, include serial number using openssl's index.txt
    primarykey
    data
    text
    <p><strong>Problem Description:</strong> </p> <p>I need to build a regular expression / pattern to find a value that can either be decimal or hex</p> <p><strong>Background Information:</strong> </p> <p>I am trying to build a lua function that will lookup a cert in index.txt and return the serial number. Ultimately, I need to be able to take the full cert name and run the following command: </p> <blockquote> <p>openssl x509 -noout -in /etc/ssl/cert/myusername.6A756C65654063616E2E77746274732E6E6574.8F.crt -dates</p> </blockquote> <p>I have the logic to build the file name, all the way up to the serial number... which in the above example, is 8F.</p> <p>Here's what the index.txt file looks like: </p> <pre><code>R 140320154649Z 150325040807Z 8E unknown /CN=test@gmail.com/emailAddress=test@gmail.com V 160324050821Z 8F unknown /CN=test@yahoo.com/emailAddress=test@yahoo.com V 160324051723Z 90 unknown /CN=test2@yahoo.com/emailAddress=test2@yahoo.com </code></pre> <p>The serial number is field 4 in the first record, and field 3 in the rest of the records. According to the documentation <a href="https://www.openssl.org/docs/apps/x509.html" rel="nofollow">https://www.openssl.org/docs/apps/x509.html</a>, serial number can either be hex or decimal. I'm not quite sure yet how / who determines whether it's hex or decimal (i'm modifying someone else's code that uses openssl)... but I'm wondering if there's a way to check for both. I'll only be checking the value for records that are not Revoked ...aka. ones that do not have "R" in the first column.</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload