Format RsaTest

bzip2
Graham 5 years ago
parent e82f575695
commit c8af2288c6
  1. 22
      common/src/test/java/dev/openrs2/common/crypto/RsaTest.kt

@ -18,16 +18,18 @@ object RsaTest {
// example data from https://en.wikipedia.org/wiki/RSA_(cryptosystem)#Example // example data from https://en.wikipedia.org/wiki/RSA_(cryptosystem)#Example
private val PUBLIC_KEY = allowUnsafeMod { RSAKeyParameters(false, BigInteger("3233"), BigInteger("17")) } private val PUBLIC_KEY = allowUnsafeMod { RSAKeyParameters(false, BigInteger("3233"), BigInteger("17")) }
private val PRIVATE_KEY = allowUnsafeMod { RSAKeyParameters(true, BigInteger("3233"), BigInteger("413")) } private val PRIVATE_KEY = allowUnsafeMod { RSAKeyParameters(true, BigInteger("3233"), BigInteger("413")) }
private val PRIVATE_KEY_CRT = allowUnsafeMod { RSAPrivateCrtKeyParameters( private val PRIVATE_KEY_CRT = allowUnsafeMod {
BigInteger("3233"), // modulus RSAPrivateCrtKeyParameters(
BigInteger("17"), // public exponent BigInteger("3233"), // modulus
BigInteger("413"), // private exponent BigInteger("17"), // public exponent
BigInteger("61"), // p BigInteger("413"), // private exponent
BigInteger("53"), // q BigInteger("61"), // p
BigInteger("53"), // dP BigInteger("53"), // q
BigInteger("49"), // dQ BigInteger("53"), // dP
BigInteger("38") // qInv BigInteger("49"), // dQ
) } BigInteger("38") // qInv
)
}
private val PUBLIC_KEY_PEM = listOf( private val PUBLIC_KEY_PEM = listOf(
"-----BEGIN PUBLIC KEY-----", "-----BEGIN PUBLIC KEY-----",

Loading…
Cancel
Save