mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-11-07 12:23:14 +00:00
add additional variant of doInDecryptionContextWithPKCS8Key
This commit is contained in:
1 parent
040654f131
commit
ecc608f51a
1 file changed
+9
+9
@@ -13,3 +13,12 @@ inline fun <T> PassportData.doInDecryptionContextWithPKCS8Key(
|
||||
expectedNonce ?.let { require(expectedNonce == decryptedCredentials.nonce) }
|
||||
return decryptedCredentials.secureData.run(block)
|
||||
}
|
||||
inline fun <T> PassportData.doInDecryptionContextWithPKCS8Key(
|
||||
pkcs8Key: String,
|
||||
expectedNonce: String? = null,
|
||||
crossinline block: SecureData.() -> T
|
||||
): T {
|
||||
val decryptedCredentials = credentials.decryptWithPKCS8PrivateKey(pkcs8Key)
|
||||
expectedNonce ?.let { require(expectedNonce == decryptedCredentials.nonce) }
|
||||
return decryptedCredentials.secureData.run(block)
|
||||
}
|
||||
Reference in new issue
Block a user