mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
fix makesshpubkey
This commit is contained in:
@@ -85,17 +85,16 @@ class KeyManager: ObservableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func makeSSHPubkey(pub: Data, comment: String) -> Data {
|
func makeSSHPubkey(pub: Data, comment: String) -> Data {
|
||||||
// let header = "ssh"
|
let header = "ssh-ed25519"
|
||||||
var content: Data = Data()
|
var keyBlob: Data = Data()
|
||||||
//key type bit
|
//key type bit
|
||||||
content += encode(str: "ssh-ed25519")
|
keyBlob += encode(str: header)
|
||||||
|
|
||||||
//base64 blob bit
|
//base64 blob bit
|
||||||
content += encode(data: content)
|
keyBlob += encode(data: pub)
|
||||||
|
|
||||||
//comment bit
|
let b64key = keyBlob.base64EncodedString()
|
||||||
content += encode(str: comment)
|
let pubkeyline = "\(header) \(b64key) \(comment)\n"
|
||||||
return content
|
return Data(pubkeyline.utf8)
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeSSHPrivkey(pub: Data, priv: Data, comment: String) -> Data {
|
func makeSSHPrivkey(pub: Data, priv: Data, comment: String) -> Data {
|
||||||
|
|||||||
Reference in New Issue
Block a user