diff --git a/common/src/main/java/dev/openrs2/common/crypto/Rsa.kt b/common/src/main/java/dev/openrs2/common/crypto/Rsa.kt index d42cdc17c9..56bff81f82 100644 --- a/common/src/main/java/dev/openrs2/common/crypto/Rsa.kt +++ b/common/src/main/java/dev/openrs2/common/crypto/Rsa.kt @@ -145,7 +145,7 @@ object Rsa { return writeSinglePemObject(path, PUBLIC_KEY, spki.encoded) } - fun readPrivateKey(path: Path): RSAKeyParameters { + fun readPrivateKey(path: Path): RSAPrivateCrtKeyParameters { val der = readSinglePemObject(path, PRIVATE_KEY) val pki = PrivateKeyInfo.getInstance(der) diff --git a/common/src/test/java/dev/openrs2/common/crypto/RsaTest.kt b/common/src/test/java/dev/openrs2/common/crypto/RsaTest.kt index 93b116b597..ab029fbdba 100644 --- a/common/src/test/java/dev/openrs2/common/crypto/RsaTest.kt +++ b/common/src/test/java/dev/openrs2/common/crypto/RsaTest.kt @@ -150,7 +150,7 @@ object RsaTest { try { Files.write(file, PRIVATE_KEY_PEM) - val key = allowUnsafeMod { Rsa.readPrivateKey(file) } as RSAPrivateCrtKeyParameters + val key = allowUnsafeMod { Rsa.readPrivateKey(file) } assertTrue(key.isPrivate) assertEquals(PRIVATE_KEY_CRT.modulus, key.modulus) assertEquals(PRIVATE_KEY_CRT.exponent, key.exponent)