io.justdevit.kotlin.boost.encryption.InitialVector.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of boost-commons Show documentation
Show all versions of boost-commons Show documentation
Library to boost working with Kotlin/JVM projects.
The newest version!
package io.justdevit.kotlin.boost.encryption
import io.justdevit.kotlin.boost.base64.decode
import io.justdevit.kotlin.boost.base64.isBase64
import javax.crypto.spec.IvParameterSpec
/**
* Represents an Initial Vector for encryption and decryption.
*
* @param value The initial vector as a byte array.
*/
class InitialVector(value: ByteArray) : IvParameterSpec(value) {
/**
* Constructs an instance of the [InitialVector] for given [String] value.
*
* @param value The initial vector as text. Can be Base64 encoded text also.
*/
constructor(value: String) : this(if (value.isBase64()) value.toByteArray().decode() else value.toByteArray())
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy