1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-15 00:05:11 +02:00

now returns only a single object, not an array of CRL objects

This commit is contained in:
Kelly Brazil
2025-05-20 17:47:05 -07:00
parent e4cf7b502e
commit 816c38e1fe

View File

@ -6,6 +6,7 @@ list files.
Usage (cli):
$ cat certificateRevocationList.pem | jc --x509-crl
$ cat certificateRevocationList.der | jc --x509-crl
Usage (module):
@ -14,7 +15,6 @@ Usage (module):
Schema:
[
{
"tbs_cert_list": {
"version": string,
@ -59,7 +59,6 @@ Schema:
},
"signature": string # [0]
}
]
[0] in colon-delimited hex notation
[1] time-zone-aware (UTC) epoch timestamp
@ -323,15 +322,14 @@ def parse(
except TypeError:
der_bytes = data # type: ignore
certs = []
if pem.detect(der_bytes):
for type_name, headers, der_bytes in pem.unarmor(der_bytes, multiple=True):
if type_name == 'X509 CRL':
certs.append(crl.CertificateList.load(der_bytes))
crl_obj = crl.CertificateList.load(der_bytes)
break
else:
certs.append(crl.CertificateList.load(der_bytes))
crl_obj = crl.CertificateList.load(der_bytes)
raw_output = [_fix_objects(cert.native) for cert in certs]
raw_output = _fix_objects(crl_obj.native)
return raw_output if raw else _process(raw_output)