ssh2_parse_key
Parses ssh2 public keys in either openssh or RFC4716/Secsh formats and converts to either format.
At this point any attempt to work with private keys will raise an exception.
Features
- Reads public keys of the following encryption types:-
ssh-rsassh-dssecdsa-sha2-nistp256ssh-ed25519
- Reads either Openssh or RFC4716 format public keys
- Can read input sets with either or both formats in
- Can output either format for any key
Installation
With pip:
python3.6 -m pip install ssh2_parse_key
Usage
To use SSH2 Key Parsing in a project
from ssh2_parse_key import Ssh2Key
# although you can create the object from internal data the normal method
# would be to use the parse() or parse_file() which return a list of Ssh2Key objects.
# Ssh2Key objects are immutable.
# Load one or more keys in either openssh or RFC4716 from a file
keys = Ssh2Key.parse_file("/path/to/public_key")
# alternatively
data = Path("/path/to/public_key").read_text()
keys = Ssh2Key.parse(data)
# now those keys can be dealt with...
for public_key in keys:
print(f"This is a {key.key_type} key")
print(f"It uses {key.encryption} encryption")
print(f"comment = {key.comment}")
print(f"subject = {key.subject}")
print("RFC4716 format representation")
print(key.rfc4716())
print("OpenSSH representation")
print(key.openssh())
Credits
The package is strongly based on the perl
Parse::SSH2::PublicKey
module.
Development on the python version was done by
Nigel Metheringham <nigelm@cpan.org>
Metadata
Release files for ssh2_parse_key 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ssh2_parse_key-0.8.0.tar.gz | 19.0 kB | Without provenance | Details for ssh2_parse_key-0.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ssh2_parse_key-0.8.0-py3-none-any.whl | Python 3 | none | any | Details for ssh2_parse_key-0.8.0-py3-none-any.whl |
Total release size: 38.6 kB
Release files / ssh2_parse_key-0.8.0.tar.gz
| Download URL | ssh2_parse_key-0.8.0.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77ef9e68f45064d3c12e136ba6c0ff0877261034df2c44578111e1dc008dc491
|
|
BLAKE2b-256 checksum How to use checksums |
83178d2ea6007df8f8a8477da368675b4c8f62dd4b9941061c0970e1aa8ce42a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0
|
Release files / ssh2_parse_key-0.8.0-py3-none-any.whl
| Download URL | ssh2_parse_key-0.8.0-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
670b760305706c8ee32dae71211f9e5c29281fd5aadba05253a15c3715812ca3
|
|
BLAKE2b-256 checksum How to use checksums |
0da218724d9b1c96d7a35f791b2d325888b620e67ed3a921ceade6a23a336bc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0
|
Security for ssh2_parse_key 0.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.