mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
now returns only a single object, not an array of CRL objects
This commit is contained in:
@ -6,6 +6,7 @@ list files.
|
|||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
$ cat certificateRevocationList.pem | jc --x509-crl
|
$ cat certificateRevocationList.pem | jc --x509-crl
|
||||||
|
$ cat certificateRevocationList.der | jc --x509-crl
|
||||||
|
|
||||||
Usage (module):
|
Usage (module):
|
||||||
|
|
||||||
@ -14,7 +15,6 @@ Usage (module):
|
|||||||
|
|
||||||
Schema:
|
Schema:
|
||||||
|
|
||||||
[
|
|
||||||
{
|
{
|
||||||
"tbs_cert_list": {
|
"tbs_cert_list": {
|
||||||
"version": string,
|
"version": string,
|
||||||
@ -59,7 +59,6 @@ Schema:
|
|||||||
},
|
},
|
||||||
"signature": string # [0]
|
"signature": string # [0]
|
||||||
}
|
}
|
||||||
]
|
|
||||||
|
|
||||||
[0] in colon-delimited hex notation
|
[0] in colon-delimited hex notation
|
||||||
[1] time-zone-aware (UTC) epoch timestamp
|
[1] time-zone-aware (UTC) epoch timestamp
|
||||||
@ -323,15 +322,14 @@ def parse(
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
der_bytes = data # type: ignore
|
der_bytes = data # type: ignore
|
||||||
|
|
||||||
certs = []
|
|
||||||
if pem.detect(der_bytes):
|
if pem.detect(der_bytes):
|
||||||
for type_name, headers, der_bytes in pem.unarmor(der_bytes, multiple=True):
|
for type_name, headers, der_bytes in pem.unarmor(der_bytes, multiple=True):
|
||||||
if type_name == 'X509 CRL':
|
if type_name == 'X509 CRL':
|
||||||
certs.append(crl.CertificateList.load(der_bytes))
|
crl_obj = crl.CertificateList.load(der_bytes)
|
||||||
|
break
|
||||||
else:
|
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)
|
return raw_output if raw else _process(raw_output)
|
||||||
|
Reference in New Issue
Block a user