@ -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)
@ -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)