mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-21 00:19:42 +02:00
doc update
This commit is contained in:
62
docs/parsers/x509_cert.md
Normal file
62
docs/parsers/x509_cert.md
Normal file
@ -0,0 +1,62 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.x509_cert"></a>
|
||||
|
||||
# jc.parsers.x509\_cert
|
||||
|
||||
jc - JSON Convert X.509 Certificate format file parser
|
||||
|
||||
This parser will convert DER and PEM encoded X.509 certificates.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat certificate.pem | jc --x509-cert
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('x509_cert', x509_cert_file_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"x509_cert": string,
|
||||
"bar": boolean,
|
||||
"baz": integer
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ cat certificate.pem | jc --x509-cert -p
|
||||
[]
|
||||
|
||||
$ cat certificate.der | jc --x509-cert -p -r
|
||||
[]
|
||||
|
||||
<a id="jc.parsers.x509_cert.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: Union[str, bytes],
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[Dict]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
@ -102,20 +102,23 @@ Returns:
|
||||
### has\_data
|
||||
|
||||
```python
|
||||
def has_data(data: str) -> bool
|
||||
def has_data(data: Union[str, bytes]) -> bool
|
||||
```
|
||||
|
||||
Checks if the input contains data. If there are any non-whitespace
|
||||
characters then return `True`, else return `False`.
|
||||
Checks if the string input contains data. If there are any
|
||||
non-whitespace characters then return `True`, else return `False`.
|
||||
|
||||
For bytes, returns True if there is any data.
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) input to check whether it contains data
|
||||
data: (string, bytes) input to check whether it contains data
|
||||
|
||||
Returns:
|
||||
|
||||
Boolean True if input string (data) contains non-whitespace
|
||||
characters, otherwise False
|
||||
characters, otherwise False. For bytes data, returns
|
||||
True if there is any data, otherwise False.
|
||||
|
||||
<a id="jc.utils.convert_to_int"></a>
|
||||
|
||||
|
Reference in New Issue
Block a user