Signed-off-by: Graham <gpe@openrs2.org>
@ -51,6 +51,7 @@ public class Pkcs12KeyStore private constructor(privateKeyEntry: KeyStore.Privat
private val SHA256_WITH_RSA = AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption)
private val SHA256 = AlgorithmIdentifier(NISTObjectIdentifiers.id_sha256)
@JvmStatic
public fun open(path: Path, signerName: String): Pkcs12KeyStore {
val keyStore = KeyStore.getInstance("PKCS12")
if (Files.exists(path)) {
@ -266,6 +266,8 @@ public class Whirlpool {
}
@JvmOverloads
public fun whirlpool(data: ByteArray, off: Int = 0, len: Int = data.size): ByteArray {
val source: ByteArray
if (off <= 0) {
@ -32,18 +32,22 @@ public data class XteaKey(
public companion object {
public val ZERO: XteaKey = XteaKey(0, 0, 0, 0)
public fun fromIntArray(a: IntArray): XteaKey {
require(a.size == 4)
return XteaKey(a[0], a[1], a[2], a[3])
public fun fromHex(s: String): XteaKey {
return fromHexOrNull(s) ?: throw IllegalArgumentException()
public fun fromHexOrNull(s: String): XteaKey? {
if (s.length != 32) {
return null