I am writing a Kotlin AES decrypter and because of this I am using the Base64.decode function. However I cannot solve the reference error of the Base64 class. This is not an Android app, but a Kotlin Console Application that I run on my Windows machine in IntelliJ.
- Kotlin 1.6
- IDE: IntelliJ 2021.2.3
- JVM 1.6.0
- jvmTarget 1.8
My code:
import java.util.*
import javax.crypto.spec.IvParameterSpec
class test {
fun test(){
val ivParameterSpec = IvParameterSpec(Base64.decode("iv", Base64.DEFAULT))
}
}
I've also tried:
import java.util.Base64
import javax.crypto.spec.IvParameterSpec
class test {
fun test(){
val ivParameterSpec = IvParameterSpec(Base64.decode("iv", Base64.DEFAULT))
}
}
Both gives the error:
Unresolved reference: decode'
and
Unresolved reference: DEFAULT