mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +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 keyPairGenerationResult = KeyPairUtilities.generate()
|
||||
val seed = keyPairGenerationResult.seed
|
||||
val ed25519KeyPair = keyPairGenerationResult.ed25519KeyPair
|
||||
val x25519KeyPair = keyPairGenerationResult.x25519KeyPair
|
||||
|
||||
when {
|
||||
displayName.isEmpty() -> { state.update { it.copy(error = R.string.displayNameErrorDescription) } }
|
||||
displayName.length > NAME_PADDED_LENGTH -> { state.update { it.copy(error = R.string.displayNameErrorDescriptionShorter) } }
|
||||
@ -58,6 +53,11 @@ class PickDisplayNameViewModel(
|
||||
database.clearAllLastMessageHashes()
|
||||
database.clearReceivedMessageHashValues()
|
||||
|
||||
val keyPairGenerationResult = KeyPairUtilities.generate()
|
||||
val seed = keyPairGenerationResult.seed
|
||||
val ed25519KeyPair = keyPairGenerationResult.ed25519KeyPair
|
||||
val x25519KeyPair = keyPairGenerationResult.x25519KeyPair
|
||||
|
||||
KeyPairUtilities.store(context, seed, ed25519KeyPair, x25519KeyPair)
|
||||
configFactory.keyPairChanged()
|
||||
val userHexEncodedPublicKey = x25519KeyPair.hexEncodedPublicKey
|
||||
|
Loading…
Reference in New Issue
Block a user