mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 12:00:03 +03:00
use pkEncryption, to properly close it.
This commit is contained in:
parent
f7195a878a
commit
e89bec4f27
1 changed files with 3 additions and 1 deletions
|
@ -46,7 +46,9 @@ internal object ScanEncryptorUtils {
|
||||||
return if (publicServerKey != null) {
|
return if (publicServerKey != null) {
|
||||||
// Note: fromBase64 can throw Exception
|
// Note: fromBase64 can throw Exception
|
||||||
val pkEncryption = PkEncryption.fromBase64(key = publicServerKey)
|
val pkEncryption = PkEncryption.fromBase64(key = publicServerKey)
|
||||||
val pkMessage = pkEncryption.encrypt(DownloadBody(encryptedInfo).toCanonicalJson())
|
val pkMessage = pkEncryption.use {
|
||||||
|
pkEncryption.encrypt(DownloadBody(encryptedInfo).toCanonicalJson())
|
||||||
|
}
|
||||||
DownloadBody(
|
DownloadBody(
|
||||||
encryptedBody = EncryptedBody(
|
encryptedBody = EncryptedBody(
|
||||||
cipherText = pkMessage.ciphertext,
|
cipherText = pkMessage.ciphertext,
|
||||||
|
|
Loading…
Add table
Reference in a new issue