Difference between revisions of "Ssh key parsing"

From UVOO Tech Wiki
Jump to navigation Jump to search
(Created page with "https://github.com/nigelm/ssh2_parse_key pip3 install ssh2-parse-key from ssh2_parse_key import Ssh2Key key="SSH2 multiline" key.openssh()")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
https://github.com/nigelm/ssh2_parse_key
 
https://github.com/nigelm/ssh2_parse_key
 +
```
 +
pip3 install ssh2-parse-key
 +
```
  
pip3 install ssh2-parse-key
+
```
 
from ssh2_parse_key import Ssh2Key
 
from ssh2_parse_key import Ssh2Key
key="SSH2 multiline"
+
 
key.openssh()
+
public_key="""---- BEGIN SSH2 PUBLIC KEY ----
 +
...
 +
---- END SSH2 PUBLIC KEY ----"""
 +
 
 +
pubkey = Ssh2Key.parse(public_key)[0]
 +
openssh_pubkey = pubkey.openssh()
 +
```

Latest revision as of 16:54, 10 March 2022

https://github.com/nigelm/ssh2_parse_key

pip3 install ssh2-parse-key
from ssh2_parse_key import Ssh2Key

public_key="""---- BEGIN SSH2 PUBLIC KEY ----
...
---- END SSH2 PUBLIC KEY ----"""

pubkey = Ssh2Key.parse(public_key)[0]
openssh_pubkey = pubkey.openssh()