All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.webhook.WebhookPrivateKeyConfig.kt Maven / Gradle / Ivy

There is a newer version: 0.28.3
Show newest version
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()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy