diff options
Diffstat (limited to 'app/src/main/java/dev')
-rw-r--r-- | app/src/main/java/dev/msfjarvis/aps/data/crypto/CryptoRepository.kt | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/data/crypto/CryptoRepository.kt b/app/src/main/java/dev/msfjarvis/aps/data/crypto/CryptoRepository.kt index 2923b117..0e262e7a 100644 --- a/app/src/main/java/dev/msfjarvis/aps/data/crypto/CryptoRepository.kt +++ b/app/src/main/java/dev/msfjarvis/aps/data/crypto/CryptoRepository.kt @@ -5,7 +5,6 @@ package dev.msfjarvis.aps.data.crypto -import com.github.michaelbull.result.runCatching import com.github.michaelbull.result.unwrap import dev.msfjarvis.aps.crypto.PGPKeyManager import dev.msfjarvis.aps.crypto.PGPainlessCryptoHandler @@ -42,9 +41,7 @@ constructor( ) { val keys = pgpKeyManager.getAllKeys().unwrap() // Iterates through the keys until the first successful decryption, then returns. - keys.firstOrNull { key -> - runCatching { pgpCryptoHandler.decrypt(key, password, message, out) }.isOk() - } + keys.firstOrNull { key -> pgpCryptoHandler.decrypt(key, password, message, out).isOk() } } private suspend fun encryptPgp(content: ByteArrayInputStream, out: ByteArrayOutputStream) { |