use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project robovm by robovm.
the class RSAMultiPrimePrivateCrtKeySpecTest method testGetOtherPrimeInfo02.
/**
* Test #2 for <code>getOtherPrimeInfo()</code> method<br>
* Assertion: returns null if null has been passed to the
* constructor as otherPrimeInfo parameter
*/
public final void testGetOtherPrimeInfo02() {
RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec(BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, null);
assertNull(ks.getOtherPrimeInfo());
}
use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project robovm by robovm.
the class RSAMultiPrimePrivateCrtKeySpecTest method testGetPrivateExponent.
/**
* Test for <code>getPrivateExponent()</code> method<br>
* Assertion: returns private exponent
*/
public final void testGetPrivateExponent() {
RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec(BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi);
assertTrue(BigInteger.ONE.equals(ks.getPrivateExponent()));
}
use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project robovm by robovm.
the class RSAMultiPrimePrivateCrtKeySpecTest method testGetOtherPrimeInfo01.
/**
* Test #1 for <code>getOtherPrimeInfo()</code> method<br>
* Assertion: returns array of RSAOtherPrimeInfo
*/
public final void testGetOtherPrimeInfo01() {
RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec(BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi);
assertTrue(checkOtherPrimeInfo(ks.getOtherPrimeInfo()));
}
use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project robovm by robovm.
the class RSAMultiPrimePrivateCrtKeySpecTest method testGetPublicExponent.
/**
* Test for <code>getPublicExponent()</code> method<br>
* Assertion: returns public exponent
*/
public final void testGetPublicExponent() {
RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec(BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi);
assertTrue(BigInteger.ONE.equals(ks.getPublicExponent()));
}
use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project robovm by robovm.
the class RSAMultiPrimePrivateCrtKeySpecTest method testIsStatePreserved2.
/**
* Tests that internal state of the object
* can not be modified using array reference
* returned by <code>getOtherPrimeInfo()</code>
* method
*/
public final void testIsStatePreserved2() {
// Create initial array
RSAOtherPrimeInfo[] opi1 = opi.clone();
RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec(BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, BigInteger.ONE, opi1);
RSAOtherPrimeInfo[] ret = ks.getOtherPrimeInfo();
// Modify returned array
ret[2] = new RSAOtherPrimeInfo(BigInteger.ZERO, BigInteger.ZERO, BigInteger.ZERO);
// Check that above modification
// does not affect internal state
assertTrue(checkOtherPrimeInfo(ks.getOtherPrimeInfo()));
}
Aggregations