On Tue, 23 Feb 2010, Seth Vidal wrote:
+
+ def _return_revoked_serials(self, crlfile):
+ call = '/usr/bin/openssl crl -text -noout -in %s' % crlfile
+ call = shlex.split(call)
+ serials = []
+ (res,err) = subprocess.Popen(call,
stdout=subprocess.PIPE).communicate()
+ for line in res.split('\n'):
+ if line.find('Serial Number:') == -1:
+ continue
+ (crap, serial) = line.split(':')
+ serial = serial.strip()
+ serial = int(serial, 16)
+ serials.append(serial)
+ return serials
I agree that the above is ugly. If anyone has a better idea on how to read
a crl from python, I'm all ears.
-sv
_______________________________________________
Func-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/func-list