2022-05-01 14:07:43 +02:00
import SwiftUI
struct KeyView : View {
@ Binding
var keyManager : KeyManagement
2022-05-02 17:27:56 +02:00
@ Binding
var isCompensatingDaylightTime : Bool
2022-05-01 14:07:43 +02:00
var body : some View {
GeometryReader { geo in
VStack ( alignment : . leading , spacing : 16 ) {
ForEach ( KeyManagement . KeyType . allCases ) { keyType in
SingleKeyView (
keyManager : $ keyManager ,
type : keyType )
}
2022-05-02 17:27:56 +02:00
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 )
2022-05-01 14:07:43 +02:00
} . padding ( )
}
}
}
struct KeyView_Previews : PreviewProvider {
static var previews : some View {
2022-05-02 17:27:56 +02:00
KeyView (
keyManager : . constant ( KeyManagement ( ) ) ,
isCompensatingDaylightTime : . constant ( true ) )
2022-05-01 14:07:43 +02:00
}
}