37 lines
1.1 KiB
Swift
37 lines
1.1 KiB
Swift
import SwiftUI
|
|
|
|
struct KeyView: View {
|
|
|
|
@Binding
|
|
var keyManager: KeyManagement
|
|
|
|
@Binding
|
|
var isCompensatingDaylightTime: Bool
|
|
|
|
var body: some View {
|
|
ScrollView {
|
|
VStack(alignment: .leading, spacing: 8) {
|
|
ForEach(KeyManagement.KeyType.allCases) { keyType in
|
|
SingleKeyView(
|
|
keyManager: $keyManager,
|
|
type: keyType)
|
|
}
|
|
Toggle(isOn: $isCompensatingDaylightTime) {
|
|
Text("Compensate daylight savings time")
|
|
}
|
|
Text("If the remote has daylight savings time wrongly set, then the time validation will fail. Use this option to send messages with adjusted timestamps. Warning: Incorrect use of this option will allow replay attacks.")
|
|
.font(.caption)
|
|
.foregroundColor(.secondary)
|
|
}.padding()
|
|
}
|
|
}
|
|
}
|
|
|
|
struct KeyView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
KeyView(
|
|
keyManager: .constant(KeyManagement()),
|
|
isCompensatingDaylightTime: .constant(true))
|
|
}
|
|
}
|