SQL to extract specific attributes from an x509 digital certificate
ltpsNov 15 2012 — edited Nov 20 2012I am curious whether there is a way to use SQL to extract specific attributes from an x509 digital certificate. I know how to do it using openssl - no problem. But what if the pem file is stored in a datebase column and I want to extract the expiration date. From the openssl command line, I can just do this to extract the certificate's expiration date:
openssl x509 -noout -in certificate.pem -dates | grep notAfter | awk -F= '{print $2}'
(extract just the dates | take only the line with the expiration date | print only the second column in the line delimited by =)
But if certificate.pem is stored in an Oracle database field, how to achieve the same result? Is there anything like "DBMS_OPENSSL"?
I got to thinking about V$WALLET in an Oracle database. The only columns here are CERT_ID, DN, SERIAL_NUM, ISSUER, KEYSIZE, and STATUS - no certificate, which suggests that it is stored elsewhere. As you can tell, I'm new at this.
Thanks for your help!