@@ -16,7 +16,7 @@ public protocol SharedCryptographyService: AnyObject {
16
16
/// key is not in the shared repository.
17
17
///
18
18
func decryptAuthenticatorItems(
19
- _ items: [ AuthenticatorBridgeItemDataModel ]
19
+ _ items: [ AuthenticatorBridgeItemDataModel ] ,
20
20
) async throws -> [ AuthenticatorBridgeItemDataView ]
21
21
22
22
/// Takes an array of `AuthenticatorBridgeItemDataView` with decrypted data and
@@ -28,7 +28,7 @@ public protocol SharedCryptographyService: AnyObject {
28
28
/// key is not in the shared repository.
29
29
///
30
30
func encryptAuthenticatorItems(
31
- _ items: [ AuthenticatorBridgeItemDataView ]
31
+ _ items: [ AuthenticatorBridgeItemDataView ] ,
32
32
) async throws -> [ AuthenticatorBridgeItemDataModel ]
33
33
}
34
34
@@ -55,7 +55,7 @@ public class DefaultAuthenticatorCryptographyService: SharedCryptographyService
55
55
// MARK: Methods
56
56
57
57
public func decryptAuthenticatorItems(
58
- _ items: [ AuthenticatorBridgeItemDataModel ]
58
+ _ items: [ AuthenticatorBridgeItemDataModel ] ,
59
59
) async throws -> [ AuthenticatorBridgeItemDataView ] {
60
60
guard !items. isEmpty else { return [ ] }
61
61
@@ -70,13 +70,13 @@ public class DefaultAuthenticatorCryptographyService: SharedCryptographyService
70
70
id: item. id,
71
71
name: ( try ? decrypt ( item. name, withKey: symmetricKey) ) ?? " " ,
72
72
totpKey: try ? decrypt ( item. totpKey, withKey: symmetricKey) ,
73
- username: try ? decrypt ( item. username, withKey: symmetricKey)
73
+ username: try ? decrypt ( item. username, withKey: symmetricKey) ,
74
74
)
75
75
}
76
76
}
77
77
78
78
public func encryptAuthenticatorItems(
79
- _ items: [ AuthenticatorBridgeItemDataView ]
79
+ _ items: [ AuthenticatorBridgeItemDataView ] ,
80
80
) async throws -> [ AuthenticatorBridgeItemDataModel ] {
81
81
let key = try await sharedKeychainRepository. getAuthenticatorKey ( )
82
82
let symmetricKey = SymmetricKey ( data: key)
@@ -89,7 +89,7 @@ public class DefaultAuthenticatorCryptographyService: SharedCryptographyService
89
89
id: item. id,
90
90
name: encrypt ( item. name, withKey: symmetricKey) ?? " " ,
91
91
totpKey: encrypt ( item. totpKey, withKey: symmetricKey) ,
92
- username: encrypt ( item. username, withKey: symmetricKey)
92
+ username: encrypt ( item. username, withKey: symmetricKey) ,
93
93
)
94
94
}
95
95
}
@@ -106,11 +106,11 @@ public class DefaultAuthenticatorCryptographyService: SharedCryptographyService
106
106
return nil
107
107
}
108
108
let encryptedSealedBox = try AES . GCM. SealedBox (
109
- combined: data
109
+ combined: data,
110
110
)
111
111
let decryptedBox = try AES . GCM. open (
112
112
encryptedSealedBox,
113
- using: key
113
+ using: key,
114
114
)
115
115
return String ( data: decryptedBox, encoding: . utf8)
116
116
}
0 commit comments