fix makesshpubkey

This commit is contained in:
neon443 committed 2025-06-30 19:08:29 +01:00
1 parent 497d9b23e4
commit 8bfb8257e5
1 file changed
+7 -8
+7 -8
View File
@@ -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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.