mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-06-29 04:47:48 +00:00
24 lines
698 B
Kotlin
24 lines
698 B
Kotlin
|
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()
|
||
|
}
|