mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
add additional variant of doInDecryptionContextWithPKCS8Key
This commit is contained in:
parent
040654f131
commit
ecc608f51a
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user