mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-06-03 00:15:27 +00:00
24 lines
691 B
Kotlin
24 lines
691 B
Kotlin
package com.github.insanusmokrassar.TelegramBotAPI.utils.extensions
|
|
|
|
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()
|
|
}
|