https://github.com/easypost/ssh_certificate_parser
Python library for parsing OpenSSH host/user certificates
https://github.com/easypost/ssh_certificate_parser
Last synced: 7 months ago
JSON representation
Python library for parsing OpenSSH host/user certificates
- Host: GitHub
- URL: https://github.com/easypost/ssh_certificate_parser
- Owner: EasyPost
- License: isc
- Created: 2017-01-04T02:05:09.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2025-02-13T21:16:36.000Z (12 months ago)
- Last Synced: 2025-06-17T22:16:22.258Z (8 months ago)
- Language: Python
- Size: 59.6 KB
- Stars: 7
- Watchers: 45
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE.txt
Awesome Lists containing this project
README
`ssh_certificate_parser` is a small library for interacting with [OpenSSH host/user certificates](https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/usr.bin/ssh/PROTOCOL.certkeys?rev=1.15&content-type=text/plain). Specifically, it supports RSA, DSA, and Ed25519 keys signed by an RSA certificate authority. It does not currently validate the CA signature, but merely parses out some fields.

[](https://ssh-certificate-parser.readthedocs.io/en/latest/?badge=latest)
This work is licensed under the ISC license, a copy of which can be found at [LICENSE.txt](LICENSE.txt)
## Usage
This module contains a single class, `SSHCertificate`. You can construct it with the `.from_bytes` or `.from_file` classmethods.
```python
from ssh_certificate_parser import SSHCertificate
cert = SSHCertificate.from_file('/etc/ssh/ssh_host_rsa_key-cert.pub')
remaining_seconds_of_validity = cert.remaining_validity
```
Full documentation is at .
## Development
```sh
# Install dependencies
make install
# Lint project
make lint
# Test project
make test
make coverage
```