mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
replace "WebhookPrivateKeyConfig"
This commit is contained in:
parent
25dcd9bc52
commit
f8fbe824b9
@ -21,6 +21,7 @@ some default library
|
|||||||
### 0.14.1
|
### 0.14.1
|
||||||
|
|
||||||
* Replace `UpdatesFilter` and `UpdatesPoller` into another package
|
* Replace `UpdatesFilter` and `UpdatesPoller` into another package
|
||||||
|
* Replace `WebhookPrivateKeyConfig`
|
||||||
|
|
||||||
## 0.13.0 Telegram Polls
|
## 0.13.0 Telegram Polls
|
||||||
|
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.webhook
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
import java.io.FileInputStream
|
||||||
|
import java.security.KeyStore
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class WebhookPrivateKeyConfig(
|
||||||
|
private val keyStorePath: String,
|
||||||
|
private val keyStorePassword: String,
|
||||||
|
val aliasName: String,
|
||||||
|
private val aliasPassword: String
|
||||||
|
) {
|
||||||
|
@Transient
|
||||||
|
val keyStore = KeyStore.getInstance("JKS").apply {
|
||||||
|
load(FileInputStream(keyStorePath), keyStorePassword())
|
||||||
|
}
|
||||||
|
|
||||||
|
fun keyStorePassword(): CharArray = keyStorePassword.toCharArray()
|
||||||
|
|
||||||
|
fun aliasPassword(): CharArray = aliasPassword.toCharArray()
|
||||||
|
}
|
@ -1,23 +1,12 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.utils.extensions
|
package com.github.insanusmokrassar.TelegramBotAPI.utils.extensions
|
||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.webhook.WebhookPrivateKeyConfig
|
||||||
import kotlinx.serialization.Transient
|
|
||||||
import java.io.FileInputStream
|
|
||||||
import java.security.KeyStore
|
|
||||||
|
|
||||||
@Serializable
|
@Deprecated(
|
||||||
data class WebhookPrivateKeyConfig(
|
"Replaced in separated package",
|
||||||
private val keyStorePath: String,
|
ReplaceWith(
|
||||||
private val keyStorePassword: String,
|
"WebhookPrivateKeyConfig",
|
||||||
val aliasName: String,
|
"com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.webhook.WebhookPrivateKeyConfig"
|
||||||
private val aliasPassword: String
|
)
|
||||||
) {
|
)
|
||||||
@Transient
|
typealias WebhookPrivateKeyConfig = WebhookPrivateKeyConfig
|
||||||
val keyStore = KeyStore.getInstance("JKS").apply {
|
|
||||||
load(FileInputStream(keyStorePath), keyStorePassword())
|
|
||||||
}
|
|
||||||
|
|
||||||
fun keyStorePassword(): CharArray = keyStorePassword.toCharArray()
|
|
||||||
|
|
||||||
fun aliasPassword(): CharArray = aliasPassword.toCharArray()
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user