mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-11-07 12:23:14 +00:00
add passport in API
This commit is contained in:
1 parent
0c71133969
commit
1dc3ce2fb5
3 files changed
+49
-1
No files matched your search
+2
-1
@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.utils.passport
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.DownloadFile
|
||||
import dev.inmo.tgbotapi.requests.get.GetFile
|
||||
import dev.inmo.tgbotapi.types.passport.EncryptedCredentials
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithData
|
||||
import dev.inmo.tgbotapi.utils.nonstrictJsonFormat
|
||||
@@ -25,7 +26,7 @@ suspend fun Decryptor.decrypt(
|
||||
).decrypt()
|
||||
}
|
||||
fun Decryptor.decryptData(
|
||||
data: WithData
|
||||
data: EncryptedCredentials
|
||||
) = nonstrictJsonFormat.decodeFromString(
|
||||
JsonObject.serializer(),
|
||||
data.data.encodeToByteArray().decrypt().decodeToString()
|
||||
|
||||
Reference in new issue
Block a user