mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
doc updates
This commit is contained in:
@ -1,4 +1,3 @@
|
|||||||
[](https://github.com/kellyjonbrazil/jc/actions)
|
|
||||||
[](https://pypi.org/project/jc/)
|
[](https://pypi.org/project/jc/)
|
||||||
|
|
||||||
> Check out the `jc` Python [package documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs) for developers
|
> Check out the `jc` Python [package documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs) for developers
|
||||||
@ -322,6 +321,7 @@ option.
|
|||||||
| `--wg-show` | `wg show` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/wg_show) |
|
| `--wg-show` | `wg show` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/wg_show) |
|
||||||
| `--who` | `who` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/who) |
|
| `--who` | `who` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/who) |
|
||||||
| `--x509-cert` | X.509 PEM and DER certificate file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_cert) |
|
| `--x509-cert` | X.509 PEM and DER certificate file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_cert) |
|
||||||
|
| `--x509-crl` | X.509 PEM and DER certificate revocation list file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_crl) |
|
||||||
| `--x509-csr` | X.509 PEM and DER certificate request file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_csr) |
|
| `--x509-csr` | X.509 PEM and DER certificate request file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_csr) |
|
||||||
| `--xml` | XML file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/xml) |
|
| `--xml` | XML file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/xml) |
|
||||||
| `--xrandr` | `xrandr` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/xrandr) |
|
| `--xrandr` | `xrandr` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/xrandr) |
|
||||||
|
@ -4,7 +4,7 @@ _jc()
|
|||||||
jc_about_options jc_about_mod_options jc_help_options jc_special_options
|
jc_about_options jc_about_mod_options jc_help_options jc_special_options
|
||||||
|
|
||||||
jc_commands=(acpi airport amixer apt-cache apt-get arp blkid bluetoothctl cbt certbot chage cksum crontab curl date debconf-show df dig dmidecode dpkg du efibootmgr env ethtool file findmnt finger free git gpg hciconfig host id ifconfig iostat ip ipconfig iptables iw iwconfig jobs last lastb ls lsattr lsb_release lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat needrestart netstat nmcli nsd-control ntpq os-prober pacman pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum swapon sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 tune2fs udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc wg who xrandr zipinfo zpool)
|
jc_commands=(acpi airport amixer apt-cache apt-get arp blkid bluetoothctl cbt certbot chage cksum crontab curl date debconf-show df dig dmidecode dpkg du efibootmgr env ethtool file findmnt finger free git gpg hciconfig host id ifconfig iostat ip ipconfig iptables iw iwconfig jobs last lastb ls lsattr lsb_release lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat needrestart netstat nmcli nsd-control ntpq os-prober pacman pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum swapon sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 tune2fs udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc wg who xrandr zipinfo zpool)
|
||||||
jc_parsers=(--acpi --airport --airport-s --amixer --apt-cache-show --apt-get-sqq --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --curl-head --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --efibootmgr --email-address --env --ethtool --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --http-headers --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --ipconfig --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --kv-dup --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --needrestart --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --pacman --passwd --path --path-list --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --wg-show --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
jc_parsers=(--acpi --airport --airport-s --amixer --apt-cache-show --apt-get-sqq --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --curl-head --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --efibootmgr --email-address --env --ethtool --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --http-headers --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --ipconfig --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --kv-dup --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --needrestart --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --pacman --passwd --path --path-list --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --wg-show --who --x509-cert --x509-crl --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
||||||
jc_options=(--force-color -C --debug -d --monochrome -m --meta-out -M --pretty -p --quiet -q --raw -r --slurp -s --unbuffer -u --yaml-out -y)
|
jc_options=(--force-color -C --debug -d --monochrome -m --meta-out -M --pretty -p --quiet -q --raw -r --slurp -s --unbuffer -u --yaml-out -y)
|
||||||
jc_about_options=(--about -a)
|
jc_about_options=(--about -a)
|
||||||
jc_about_mod_options=(--pretty -p --yaml-out -y --monochrome -m --force-color -C)
|
jc_about_mod_options=(--pretty -p --yaml-out -y --monochrome -m --force-color -C)
|
||||||
|
@ -125,7 +125,7 @@ _jc() {
|
|||||||
'zipinfo:run "zipinfo" command with magic syntax.'
|
'zipinfo:run "zipinfo" command with magic syntax.'
|
||||||
'zpool:run "zpool" command with magic syntax.'
|
'zpool:run "zpool" command with magic syntax.'
|
||||||
)
|
)
|
||||||
jc_parsers=(--acpi --airport --airport-s --amixer --apt-cache-show --apt-get-sqq --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --curl-head --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --efibootmgr --email-address --env --ethtool --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --http-headers --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --ipconfig --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --kv-dup --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --needrestart --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --pacman --passwd --path --path-list --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --wg-show --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
jc_parsers=(--acpi --airport --airport-s --amixer --apt-cache-show --apt-get-sqq --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --curl-head --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --efibootmgr --email-address --env --ethtool --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --http-headers --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --ipconfig --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --kv-dup --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --needrestart --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --pacman --passwd --path --path-list --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --wg-show --who --x509-cert --x509-crl --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
||||||
jc_parsers_describe=(
|
jc_parsers_describe=(
|
||||||
'--acpi:`acpi` command parser'
|
'--acpi:`acpi` command parser'
|
||||||
'--airport:`airport -I` command parser'
|
'--airport:`airport -I` command parser'
|
||||||
@ -344,6 +344,7 @@ _jc() {
|
|||||||
'--wg-show:`wg show` command parser'
|
'--wg-show:`wg show` command parser'
|
||||||
'--who:`who` command parser'
|
'--who:`who` command parser'
|
||||||
'--x509-cert:X.509 PEM and DER certificate file parser'
|
'--x509-cert:X.509 PEM and DER certificate file parser'
|
||||||
|
'--x509-crl:X.509 PEM and DER certificate revocation list file parser'
|
||||||
'--x509-csr:X.509 PEM and DER certificate request file parser'
|
'--x509-csr:X.509 PEM and DER certificate request file parser'
|
||||||
'--xml:XML file parser'
|
'--xml:XML file parser'
|
||||||
'--xrandr:`xrandr` command parser'
|
'--xrandr:`xrandr` command parser'
|
||||||
|
12
docs/lib.md
12
docs/lib.md
@ -36,7 +36,7 @@ returned.
|
|||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
documentation: (boolean) include parser docstrings if True
|
documentation: (boolean) include parser docstrings if `True`
|
||||||
show_hidden: (boolean) also show parsers marked as hidden
|
show_hidden: (boolean) also show parsers marked as hidden
|
||||||
in their info metadata.
|
in their info metadata.
|
||||||
show_deprecated: (boolean) also show parsers marked as
|
show_deprecated: (boolean) also show parsers marked as
|
||||||
@ -172,17 +172,17 @@ Parameters:
|
|||||||
variants of the module name.
|
variants of the module name.
|
||||||
|
|
||||||
A Module object can also be passed
|
A Module object can also be passed
|
||||||
directly or via get_parser()
|
directly or via `get_parser()`
|
||||||
|
|
||||||
data: (string or data to parse (string or bytes for
|
data: (string or data to parse (string or bytes for
|
||||||
bytes or standard parsers, iterable of
|
bytes or standard parsers, iterable of
|
||||||
iterable) strings for streaming parsers)
|
iterable) strings for streaming parsers)
|
||||||
|
|
||||||
raw: (boolean) output preprocessed JSON if True
|
raw: (boolean) output preprocessed JSON if `True`
|
||||||
|
|
||||||
quiet: (boolean) suppress warning messages if True
|
quiet: (boolean) suppress warning messages if `True`
|
||||||
|
|
||||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
ignore_exceptions: (boolean) ignore parsing exceptions if `True`
|
||||||
(streaming parsers only)
|
(streaming parsers only)
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -209,7 +209,7 @@ Parameters:
|
|||||||
variants of the module name as well
|
variants of the module name as well
|
||||||
as a parser module object.
|
as a parser module object.
|
||||||
|
|
||||||
documentation: (boolean) include parser docstring if True
|
documentation: (boolean) include parser docstring if `True`
|
||||||
|
|
||||||
<a id="jc.lib.parser_mod_list"></a>
|
<a id="jc.lib.parser_mod_list"></a>
|
||||||
|
|
||||||
|
304
docs/parsers/x509_crl.md
Normal file
304
docs/parsers/x509_crl.md
Normal file
@ -0,0 +1,304 @@
|
|||||||
|
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||||
|
<a id="jc.parsers.x509_crl"></a>
|
||||||
|
|
||||||
|
# jc.parsers.x509_crl
|
||||||
|
|
||||||
|
jc - JSON Convert X.509 Certificate Revocation List format file parser
|
||||||
|
|
||||||
|
This parser will convert DER and PEM encoded X.509 certificate revocation
|
||||||
|
list files.
|
||||||
|
|
||||||
|
Usage (cli):
|
||||||
|
|
||||||
|
$ cat certificateRevocationList.pem | jc --x509-crl
|
||||||
|
$ cat certificateRevocationList.der | jc --x509-crl
|
||||||
|
|
||||||
|
Usage (module):
|
||||||
|
|
||||||
|
import jc
|
||||||
|
result = jc.parse('x509_crl', x509_crl_file_output)
|
||||||
|
|
||||||
|
Schema:
|
||||||
|
|
||||||
|
{
|
||||||
|
"tbs_cert_list": {
|
||||||
|
"version": string,
|
||||||
|
"signature": {
|
||||||
|
"algorithm": string,
|
||||||
|
"parameters": string/null
|
||||||
|
},
|
||||||
|
"issuer": {
|
||||||
|
"organization_name": string,
|
||||||
|
"organizational_unit_name": string,
|
||||||
|
"common_name": string
|
||||||
|
},
|
||||||
|
"this_update": integer, # [1]
|
||||||
|
"next_update": integer, # [1]
|
||||||
|
"revoked_certificates": [
|
||||||
|
{
|
||||||
|
"user_certificate": integer,
|
||||||
|
"revocation_date": integer, # [1]
|
||||||
|
"crl_entry_extensions": [
|
||||||
|
{
|
||||||
|
"extn_id": string,
|
||||||
|
"critical": boolean,
|
||||||
|
"extn_value": string,
|
||||||
|
"extn_value_iso": string
|
||||||
|
},
|
||||||
|
"revocation_date_iso": string
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"crl_extensions": [
|
||||||
|
{
|
||||||
|
"extn_id": string,
|
||||||
|
"critical": boolean,
|
||||||
|
"extn_value": array/object/string/integer # [2]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"this_update_iso": string,
|
||||||
|
"next_update_iso": string
|
||||||
|
},
|
||||||
|
"signature_algorithm": {
|
||||||
|
"algorithm": string,
|
||||||
|
"parameters": string/null
|
||||||
|
},
|
||||||
|
"signature": string # [0]
|
||||||
|
}
|
||||||
|
|
||||||
|
[0] in colon-delimited hex notation
|
||||||
|
[1] time-zone-aware (UTC) epoch timestamp
|
||||||
|
[2] See below for well-known Extension schemas:
|
||||||
|
|
||||||
|
Basic Constraints:
|
||||||
|
{
|
||||||
|
"extn_id": "basic_constraints",
|
||||||
|
"critical": boolean,
|
||||||
|
"extn_value": {
|
||||||
|
"ca": boolean,
|
||||||
|
"path_len_constraint": string/null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Key Usage:
|
||||||
|
{
|
||||||
|
"extn_id": "key_usage",
|
||||||
|
"critical": boolean,
|
||||||
|
"extn_value": [
|
||||||
|
string
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
Key Identifier:
|
||||||
|
{
|
||||||
|
"extn_id": "key_identifier",
|
||||||
|
"critical": boolean,
|
||||||
|
"extn_value": string # [0]
|
||||||
|
}
|
||||||
|
|
||||||
|
Authority Key Identifier:
|
||||||
|
{
|
||||||
|
"extn_id": "authority_key_identifier",
|
||||||
|
"critical": boolean,
|
||||||
|
"extn_value": {
|
||||||
|
"key_identifier": string, # [0]
|
||||||
|
"authority_cert_issuer": string/null,
|
||||||
|
"authority_cert_serial_number": string/null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Subject Alternative Name:
|
||||||
|
{
|
||||||
|
"extn_id": "subject_alt_name",
|
||||||
|
"critical": boolean,
|
||||||
|
"extn_value": [
|
||||||
|
string
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
Certificate Policies:
|
||||||
|
{
|
||||||
|
"extn_id": "certificate_policies",
|
||||||
|
"critical": boolean,
|
||||||
|
"extn_value": [
|
||||||
|
{
|
||||||
|
"policy_identifier": string,
|
||||||
|
"policy_qualifiers": [ array or null
|
||||||
|
{
|
||||||
|
"policy_qualifier_id": string,
|
||||||
|
"qualifier": string
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
Signed Certificate Timestamp List:
|
||||||
|
{
|
||||||
|
"extn_id": "signed_certificate_timestamp_list",
|
||||||
|
"critical": boolean,
|
||||||
|
"extn_value": string # [0]
|
||||||
|
}
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
$ cat sample-crl.pem | jc --x509-crl -p
|
||||||
|
{
|
||||||
|
"tbs_cert_list": {
|
||||||
|
"version": "v2",
|
||||||
|
"signature": {
|
||||||
|
"algorithm": "sha1_rsa",
|
||||||
|
"parameters": null
|
||||||
|
},
|
||||||
|
"issuer": {
|
||||||
|
"organization_name": "Sample Signer Organization",
|
||||||
|
"organizational_unit_name": "Sample Signer Unit",
|
||||||
|
"common_name": "Sample Signer Cert"
|
||||||
|
},
|
||||||
|
"this_update": 1361183520,
|
||||||
|
"next_update": 1361184120,
|
||||||
|
"revoked_certificates": [
|
||||||
|
{
|
||||||
|
"user_certificate": 1341767,
|
||||||
|
"revocation_date": 1361182932,
|
||||||
|
"crl_entry_extensions": [
|
||||||
|
{
|
||||||
|
"extn_id": "crl_reason",
|
||||||
|
"critical": false,
|
||||||
|
"extn_value": "affiliation_changed"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"extn_id": "invalidity_date",
|
||||||
|
"critical": false,
|
||||||
|
"extn_value": 1361182920,
|
||||||
|
"extn_value_iso": "2013-02-18T10:22:00+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"revocation_date_iso": "2013-02-18T10:22:12+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"user_certificate": 1341768,
|
||||||
|
"revocation_date": 1361182942,
|
||||||
|
"crl_entry_extensions": [
|
||||||
|
{
|
||||||
|
"extn_id": "crl_reason",
|
||||||
|
"critical": false,
|
||||||
|
"extn_value": "certificate_hold"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"extn_id": "invalidity_date",
|
||||||
|
"critical": false,
|
||||||
|
"extn_value": 1361182920,
|
||||||
|
"extn_value_iso": "2013-02-18T10:22:00+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"revocation_date_iso": "2013-02-18T10:22:22+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"user_certificate": 1341769,
|
||||||
|
"revocation_date": 1361182952,
|
||||||
|
"crl_entry_extensions": [
|
||||||
|
{
|
||||||
|
"extn_id": "crl_reason",
|
||||||
|
"critical": false,
|
||||||
|
"extn_value": "superseded"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"extn_id": "invalidity_date",
|
||||||
|
"critical": false,
|
||||||
|
"extn_value": 1361182920,
|
||||||
|
"extn_value_iso": "2013-02-18T10:22:00+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"revocation_date_iso": "2013-02-18T10:22:32+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"user_certificate": 1341770,
|
||||||
|
"revocation_date": 1361182962,
|
||||||
|
"crl_entry_extensions": [
|
||||||
|
{
|
||||||
|
"extn_id": "crl_reason",
|
||||||
|
"critical": false,
|
||||||
|
"extn_value": "key_compromise"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"extn_id": "invalidity_date",
|
||||||
|
"critical": false,
|
||||||
|
"extn_value": 1361182920,
|
||||||
|
"extn_value_iso": "2013-02-18T10:22:00+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"revocation_date_iso": "2013-02-18T10:22:42+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"user_certificate": 1341771,
|
||||||
|
"revocation_date": 1361182971,
|
||||||
|
"crl_entry_extensions": [
|
||||||
|
{
|
||||||
|
"extn_id": "crl_reason",
|
||||||
|
"critical": false,
|
||||||
|
"extn_value": "cessation_of_operation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"extn_id": "invalidity_date",
|
||||||
|
"critical": false,
|
||||||
|
"extn_value": 1361182920,
|
||||||
|
"extn_value_iso": "2013-02-18T10:22:00+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"revocation_date_iso": "2013-02-18T10:22:51+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"crl_extensions": [
|
||||||
|
{
|
||||||
|
"extn_id": "authority_key_identifier",
|
||||||
|
"critical": false,
|
||||||
|
"extn_value": {
|
||||||
|
"key_identifier": "be:12:01:cc:aa:ea:11:80:da:2e:ad:b2...",
|
||||||
|
"authority_cert_issuer": null,
|
||||||
|
"authority_cert_serial_number": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"extn_id": "crl_number",
|
||||||
|
"critical": false,
|
||||||
|
"extn_value": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"this_update_iso": "2013-02-18T10:32:00+00:00",
|
||||||
|
"next_update_iso": "2013-02-18T10:42:00+00:00"
|
||||||
|
},
|
||||||
|
"signature_algorithm": {
|
||||||
|
"algorithm": "sha1_rsa",
|
||||||
|
"parameters": null
|
||||||
|
},
|
||||||
|
"signature": "42:21:be:81:f1:c3:79:76:66:5b:ce:21:13:8a:68:a..."
|
||||||
|
}
|
||||||
|
|
||||||
|
<a id="jc.parsers.x509_crl.parse"></a>
|
||||||
|
|
||||||
|
### parse
|
||||||
|
|
||||||
|
```python
|
||||||
|
def parse(data: Union[str, bytes],
|
||||||
|
raw: bool = False,
|
||||||
|
quiet: bool = False) -> Dict
|
||||||
|
```
|
||||||
|
|
||||||
|
Main text parsing function
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
|
||||||
|
data: (string or bytes) text or binary data to parse
|
||||||
|
raw: (boolean) unprocessed output if True
|
||||||
|
quiet: (boolean) suppress warning messages if True
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
Dictionary. Raw or processed structured data.
|
||||||
|
|
||||||
|
### Parser Information
|
||||||
|
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||||
|
|
||||||
|
Source: [`jc/parsers/x509_crl.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/x509_crl.py)
|
||||||
|
|
||||||
|
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
@ -23,8 +23,9 @@ jc - JSON Convert streaming utils
|
|||||||
def add_jc_meta(func: ~F) -> ~F
|
def add_jc_meta(func: ~F) -> ~F
|
||||||
```
|
```
|
||||||
|
|
||||||
Decorator for streaming parsers to add stream_success and stream_error
|
Decorator for streaming parsers to add `stream_success` and
|
||||||
objects. This simplifies the yield lines in the streaming parsers.
|
`stream_error` objects. This simplifies the `yield` lines in the
|
||||||
|
streaming parsers.
|
||||||
|
|
||||||
With the decorator on parse():
|
With the decorator on parse():
|
||||||
|
|
||||||
@ -58,7 +59,7 @@ In all cases above:
|
|||||||
successfully parse.
|
successfully parse.
|
||||||
|
|
||||||
ignore_exceptions: (bool) continue processing lines and ignore
|
ignore_exceptions: (bool) continue processing lines and ignore
|
||||||
exceptions if True.
|
exceptions if `True`.
|
||||||
|
|
||||||
<a id="jc.streaming.raise_or_yield"></a>
|
<a id="jc.streaming.raise_or_yield"></a>
|
||||||
|
|
||||||
@ -69,8 +70,8 @@ def raise_or_yield(ignore_exceptions: bool, e: BaseException,
|
|||||||
line: str) -> Tuple[BaseException, str]
|
line: str) -> Tuple[BaseException, str]
|
||||||
```
|
```
|
||||||
|
|
||||||
Return the exception object and line string if ignore_exceptions is
|
Return the exception object and line string if `ignore_exceptions` is
|
||||||
True. Otherwise, re-raise the exception from the exception object with
|
`True`. Otherwise, re-raise the exception from the exception object with
|
||||||
an annotation.
|
an annotation.
|
||||||
|
|
||||||
<a id="jc.streaming.stream_error"></a>
|
<a id="jc.streaming.stream_error"></a>
|
||||||
|
@ -44,7 +44,7 @@ Parameters:
|
|||||||
the parser. compatible options:
|
the parser. compatible options:
|
||||||
linux, darwin, cygwin, win32, aix, freebsd
|
linux, darwin, cygwin, win32, aix, freebsd
|
||||||
|
|
||||||
quiet: (bool) suppress compatibility message if True
|
quiet: (bool) suppress compatibility message if `True`
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ Parameters:
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
None - just prints output to STDERR
|
None - just prints output to `STDERR`
|
||||||
|
|
||||||
<a id="jc.utils.has_data"></a>
|
<a id="jc.utils.has_data"></a>
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ def has_data(data: Union[str, bytes]) -> bool
|
|||||||
Checks if the string input contains data. If there are any
|
Checks if the string input contains data. If there are any
|
||||||
non-whitespace characters then return `True`, else return `False`.
|
non-whitespace characters then return `True`, else return `False`.
|
||||||
|
|
||||||
For bytes, returns True if there is any data.
|
For bytes, returns `True` if there is any data.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
@ -202,9 +202,9 @@ Parameters:
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
Boolean True if input string (data) contains non-whitespace
|
Boolean `True` if input string (data) contains non-whitespace
|
||||||
characters, otherwise False. For bytes data, returns
|
characters, otherwise `False`. For bytes data, returns
|
||||||
True if there is any data, otherwise False.
|
`True` if there is any data, otherwise `False`.
|
||||||
|
|
||||||
<a id="jc.utils.input_type_check"></a>
|
<a id="jc.utils.input_type_check"></a>
|
||||||
|
|
||||||
|
21
jc/lib.py
21
jc/lib.py
@ -347,7 +347,8 @@ def _get_parser(parser_mod_name: str) -> ModuleType:
|
|||||||
|
|
||||||
def _parser_is_slurpable(parser: ModuleType) -> bool:
|
def _parser_is_slurpable(parser: ModuleType) -> bool:
|
||||||
"""
|
"""
|
||||||
Returns True if this parser can use the `--slurp` command option, else False
|
Returns `True` if this parser can use the `--slurp` command option, else
|
||||||
|
`False`
|
||||||
|
|
||||||
parser is a parser module object.
|
parser is a parser module object.
|
||||||
"""
|
"""
|
||||||
@ -359,7 +360,7 @@ def _parser_is_slurpable(parser: ModuleType) -> bool:
|
|||||||
|
|
||||||
def _parser_is_streaming(parser: ModuleType) -> bool:
|
def _parser_is_streaming(parser: ModuleType) -> bool:
|
||||||
"""
|
"""
|
||||||
Returns True if this is a streaming parser, else False
|
Returns `True` if this is a streaming parser, else `False`
|
||||||
|
|
||||||
parser is a parser module object.
|
parser is a parser module object.
|
||||||
"""
|
"""
|
||||||
@ -370,7 +371,7 @@ def _parser_is_streaming(parser: ModuleType) -> bool:
|
|||||||
|
|
||||||
def _parser_is_hidden(parser: ModuleType) -> bool:
|
def _parser_is_hidden(parser: ModuleType) -> bool:
|
||||||
"""
|
"""
|
||||||
Returns True if this is a hidden parser, else False
|
Returns `True` if this is a hidden parser, else `False`
|
||||||
|
|
||||||
parser is a parser module object.
|
parser is a parser module object.
|
||||||
"""
|
"""
|
||||||
@ -381,7 +382,7 @@ def _parser_is_hidden(parser: ModuleType) -> bool:
|
|||||||
|
|
||||||
def _parser_is_deprecated(parser: ModuleType) -> bool:
|
def _parser_is_deprecated(parser: ModuleType) -> bool:
|
||||||
"""
|
"""
|
||||||
Returns True if this is a deprecated parser, else False
|
Returns `True` if this is a deprecated parser, else `False`
|
||||||
|
|
||||||
parser is a parser module object.
|
parser is a parser module object.
|
||||||
"""
|
"""
|
||||||
@ -468,17 +469,17 @@ def parse(
|
|||||||
variants of the module name.
|
variants of the module name.
|
||||||
|
|
||||||
A Module object can also be passed
|
A Module object can also be passed
|
||||||
directly or via get_parser()
|
directly or via `get_parser()`
|
||||||
|
|
||||||
data: (string or data to parse (string or bytes for
|
data: (string or data to parse (string or bytes for
|
||||||
bytes or standard parsers, iterable of
|
bytes or standard parsers, iterable of
|
||||||
iterable) strings for streaming parsers)
|
iterable) strings for streaming parsers)
|
||||||
|
|
||||||
raw: (boolean) output preprocessed JSON if True
|
raw: (boolean) output preprocessed JSON if `True`
|
||||||
|
|
||||||
quiet: (boolean) suppress warning messages if True
|
quiet: (boolean) suppress warning messages if `True`
|
||||||
|
|
||||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
ignore_exceptions: (boolean) ignore parsing exceptions if `True`
|
||||||
(streaming parsers only)
|
(streaming parsers only)
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -628,7 +629,7 @@ def parser_info(
|
|||||||
variants of the module name as well
|
variants of the module name as well
|
||||||
as a parser module object.
|
as a parser module object.
|
||||||
|
|
||||||
documentation: (boolean) include parser docstring if True
|
documentation: (boolean) include parser docstring if `True`
|
||||||
"""
|
"""
|
||||||
parser_mod = get_parser(parser_mod_name)
|
parser_mod = get_parser(parser_mod_name)
|
||||||
parser_mod_name = parser_mod.__name__.split('.')[-1]
|
parser_mod_name = parser_mod.__name__.split('.')[-1]
|
||||||
@ -665,7 +666,7 @@ def all_parser_info(
|
|||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
documentation: (boolean) include parser docstrings if True
|
documentation: (boolean) include parser docstrings if `True`
|
||||||
show_hidden: (boolean) also show parsers marked as hidden
|
show_hidden: (boolean) also show parsers marked as hidden
|
||||||
in their info metadata.
|
in their info metadata.
|
||||||
show_deprecated: (boolean) also show parsers marked as
|
show_deprecated: (boolean) also show parsers marked as
|
||||||
|
@ -47,8 +47,9 @@ def stream_error(e: BaseException, line: str) -> JSONDictType:
|
|||||||
|
|
||||||
def add_jc_meta(func: F) -> F:
|
def add_jc_meta(func: F) -> F:
|
||||||
"""
|
"""
|
||||||
Decorator for streaming parsers to add stream_success and stream_error
|
Decorator for streaming parsers to add `stream_success` and
|
||||||
objects. This simplifies the yield lines in the streaming parsers.
|
`stream_error` objects. This simplifies the `yield` lines in the
|
||||||
|
streaming parsers.
|
||||||
|
|
||||||
With the decorator on parse():
|
With the decorator on parse():
|
||||||
|
|
||||||
@ -82,7 +83,7 @@ def add_jc_meta(func: F) -> F:
|
|||||||
successfully parse.
|
successfully parse.
|
||||||
|
|
||||||
ignore_exceptions: (bool) continue processing lines and ignore
|
ignore_exceptions: (bool) continue processing lines and ignore
|
||||||
exceptions if True.
|
exceptions if `True`.
|
||||||
"""
|
"""
|
||||||
@wraps(func)
|
@wraps(func)
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
@ -109,8 +110,8 @@ def raise_or_yield(
|
|||||||
line: str
|
line: str
|
||||||
) -> Tuple[BaseException, str]:
|
) -> Tuple[BaseException, str]:
|
||||||
"""
|
"""
|
||||||
Return the exception object and line string if ignore_exceptions is
|
Return the exception object and line string if `ignore_exceptions` is
|
||||||
True. Otherwise, re-raise the exception from the exception object with
|
`True`. Otherwise, re-raise the exception from the exception object with
|
||||||
an annotation.
|
an annotation.
|
||||||
"""
|
"""
|
||||||
ignore_exceptions_msg = '... Use the ignore_exceptions option (-qq) to ignore streaming parser errors.'
|
ignore_exceptions_msg = '... Use the ignore_exceptions option (-qq) to ignore streaming parser errors.'
|
||||||
|
12
jc/utils.py
12
jc/utils.py
@ -100,7 +100,7 @@ def error_message(message_lines: List[str]) -> None:
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
None - just prints output to STDERR
|
None - just prints output to `STDERR`
|
||||||
"""
|
"""
|
||||||
columns = shutil.get_terminal_size().columns
|
columns = shutil.get_terminal_size().columns
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ def compatibility(mod_name: str, compatible: List[str], quiet: bool = False) ->
|
|||||||
the parser. compatible options:
|
the parser. compatible options:
|
||||||
linux, darwin, cygwin, win32, aix, freebsd
|
linux, darwin, cygwin, win32, aix, freebsd
|
||||||
|
|
||||||
quiet: (bool) suppress compatibility message if True
|
quiet: (bool) suppress compatibility message if `True`
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ def has_data(data: Union[str, bytes]) -> bool:
|
|||||||
Checks if the string input contains data. If there are any
|
Checks if the string input contains data. If there are any
|
||||||
non-whitespace characters then return `True`, else return `False`.
|
non-whitespace characters then return `True`, else return `False`.
|
||||||
|
|
||||||
For bytes, returns True if there is any data.
|
For bytes, returns `True` if there is any data.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
@ -177,9 +177,9 @@ def has_data(data: Union[str, bytes]) -> bool:
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
Boolean True if input string (data) contains non-whitespace
|
Boolean `True` if input string (data) contains non-whitespace
|
||||||
characters, otherwise False. For bytes data, returns
|
characters, otherwise `False`. For bytes data, returns
|
||||||
True if there is any data, otherwise False.
|
`True` if there is any data, otherwise `False`.
|
||||||
"""
|
"""
|
||||||
if isinstance(data, str):
|
if isinstance(data, str):
|
||||||
return bool(data and not data.isspace())
|
return bool(data and not data.isspace())
|
||||||
|
7
man/jc.1
7
man/jc.1
@ -1,4 +1,4 @@
|
|||||||
.TH jc 1 2025-05-10 1.25.5 "JSON Convert"
|
.TH jc 1 2025-05-27 1.25.6 "JSON Convert"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types,
|
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types,
|
||||||
and strings
|
and strings
|
||||||
@ -1122,6 +1122,11 @@ Version string parser
|
|||||||
\fB--x509-cert\fP
|
\fB--x509-cert\fP
|
||||||
X.509 PEM and DER certificate file parser
|
X.509 PEM and DER certificate file parser
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B
|
||||||
|
\fB--x509-crl\fP
|
||||||
|
X.509 PEM and DER certificate revocation list file parser
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B
|
.B
|
||||||
\fB--x509-csr\fP
|
\fB--x509-csr\fP
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
[](https://github.com/kellyjonbrazil/jc/actions)
|
|
||||||
[](https://pypi.org/project/jc/)
|
[](https://pypi.org/project/jc/)
|
||||||
|
|
||||||
> Check out the `jc` Python [package documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs) for developers
|
> Check out the `jc` Python [package documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs) for developers
|
||||||
|
Reference in New Issue
Block a user