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

io.justdevit.kotlin.boost.encryption.SecretKey.kt Maven / Gradle / Ivy

The newest version!
package io.justdevit.kotlin.boost.encryption

import javax.crypto.SecretKeyFactory
import javax.crypto.spec.SecretKeySpec

/**
 * Represents a secret key used for encryption and decryption.
 *
 * @param value The secret key used for encryption and decryption.
 * @param salt The salt value used for generating the secret key.
 */
class SecretKey(value: String, salt: String) :
    SecretKeySpec(
        SecretKeyFactory
            .getInstance(SECRET_KEY_FACTORY_ALGORITHM)
            .generateSecret(Key(secretKey = value, salt = salt))
            .encoded,
        SECRET_KEY_ALGORITHM,
    )




© 2015 - 2025 Weber Informatics LLC | Privacy Policy