mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
added generateKy to generate a key, currently only rsa update generateRSA to return the Data for pub and priv, and take a custom size bell animation better, slightly longer in total and easeinout added new generate button hardcoded to a rsa 4096 added keytype to define key types (duh) update getKeys to use the new keypair structure
49 lines
1.0 KiB
Swift
49 lines
1.0 KiB
Swift
//
|
|
// KeyManagerView.swift
|
|
// ShhShell
|
|
//
|
|
// Created by neon443 on 20/06/2025.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct KeyManagerView: View {
|
|
@ObservedObject var hostsManager: HostsManager
|
|
@ObservedObject var keyManager: KeyManager
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
|
.ignoresSafeArea(.all)
|
|
NavigationStack {
|
|
List {
|
|
Section {
|
|
ForEach(hostsManager.getKeys()) { keypair in
|
|
NavigationLink {
|
|
KeyDetailView(hostsManager: hostsManager, keypair: keypair)
|
|
} label: {
|
|
if let publicKey = keypair.publicKey {
|
|
Text(String(data: publicKey, encoding: .utf8) ?? "nil")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Button("genereate rsa") {
|
|
keyManager.generateKey(type: .rsa(4096), SEPKeyTag: "", comment: "jaklsd", passphrase: "")
|
|
}
|
|
}
|
|
.scrollContentBackground(.hidden)
|
|
.navigationTitle("Keys")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
KeyManagerView(
|
|
hostsManager: HostsManager(),
|
|
keyManager: KeyManager()
|
|
)
|
|
}
|