mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +00:00
Move x25519KeyPair
This commit is contained in:
parent
66b77abcd0
commit
922a3ce827
@ -42,11 +42,6 @@ class PickDisplayNameViewModel(
|
|||||||
|
|
||||||
val displayName = state.value.displayName
|
val displayName = state.value.displayName
|
||||||
|
|
||||||
val keyPairGenerationResult = KeyPairUtilities.generate()
|
|
||||||
val seed = keyPairGenerationResult.seed
|
|
||||||
val ed25519KeyPair = keyPairGenerationResult.ed25519KeyPair
|
|
||||||
val x25519KeyPair = keyPairGenerationResult.x25519KeyPair
|
|
||||||
|
|
||||||
when {
|
when {
|
||||||
displayName.isEmpty() -> { state.update { it.copy(error = R.string.displayNameErrorDescription) } }
|
displayName.isEmpty() -> { state.update { it.copy(error = R.string.displayNameErrorDescription) } }
|
||||||
displayName.length > NAME_PADDED_LENGTH -> { state.update { it.copy(error = R.string.displayNameErrorDescriptionShorter) } }
|
displayName.length > NAME_PADDED_LENGTH -> { state.update { it.copy(error = R.string.displayNameErrorDescriptionShorter) } }
|
||||||
@ -58,6 +53,11 @@ class PickDisplayNameViewModel(
|
|||||||
database.clearAllLastMessageHashes()
|
database.clearAllLastMessageHashes()
|
||||||
database.clearReceivedMessageHashValues()
|
database.clearReceivedMessageHashValues()
|
||||||
|
|
||||||
|
val keyPairGenerationResult = KeyPairUtilities.generate()
|
||||||
|
val seed = keyPairGenerationResult.seed
|
||||||
|
val ed25519KeyPair = keyPairGenerationResult.ed25519KeyPair
|
||||||
|
val x25519KeyPair = keyPairGenerationResult.x25519KeyPair
|
||||||
|
|
||||||
KeyPairUtilities.store(context, seed, ed25519KeyPair, x25519KeyPair)
|
KeyPairUtilities.store(context, seed, ed25519KeyPair, x25519KeyPair)
|
||||||
configFactory.keyPairChanged()
|
configFactory.keyPairChanged()
|
||||||
val userHexEncodedPublicKey = x25519KeyPair.hexEncodedPublicKey
|
val userHexEncodedPublicKey = x25519KeyPair.hexEncodedPublicKey
|
||||||
|
Loading…
Reference in New Issue
Block a user