mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-29 11:41:01 +00:00
Fix keys
This commit is contained in:
parent
da0dcbfe1c
commit
874ea309ac
1 changed files with 9 additions and 3 deletions
|
@ -133,12 +133,16 @@ public class PushNotifications: ObservableObject {
|
||||||
return try P256.KeyAgreement.PrivateKey(rawRepresentation: data)
|
return try P256.KeyAgreement.PrivateKey(rawRepresentation: data)
|
||||||
} catch {
|
} catch {
|
||||||
let key = P256.KeyAgreement.PrivateKey()
|
let key = P256.KeyAgreement.PrivateKey()
|
||||||
keychain.set(key.rawRepresentation.base64EncodedString(), forKey: Constants.keychainPrivateKey)
|
keychain.set(key.rawRepresentation.base64EncodedString(),
|
||||||
|
forKey: Constants.keychainPrivateKey,
|
||||||
|
withAccess: .accessibleAfterFirstUnlock)
|
||||||
return key
|
return key
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let key = P256.KeyAgreement.PrivateKey()
|
let key = P256.KeyAgreement.PrivateKey()
|
||||||
keychain.set(key.rawRepresentation.base64EncodedString(), forKey: Constants.keychainPrivateKey)
|
keychain.set(key.rawRepresentation.base64EncodedString(),
|
||||||
|
forKey: Constants.keychainPrivateKey,
|
||||||
|
withAccess: .accessibleAfterFirstUnlock)
|
||||||
return key
|
return key
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,7 +153,9 @@ public class PushNotifications: ObservableObject {
|
||||||
return data
|
return data
|
||||||
} else {
|
} else {
|
||||||
let key = Self.makeRandomeNotificationsAuthKey()
|
let key = Self.makeRandomeNotificationsAuthKey()
|
||||||
keychain.set(key.base64EncodedString(), forKey: Constants.keychainAuthKey)
|
keychain.set(key.base64EncodedString(),
|
||||||
|
forKey: Constants.keychainAuthKey,
|
||||||
|
withAccess: .accessibleAfterFirstUnlock)
|
||||||
return key
|
return key
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue