use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project j2objc by google.
the class RSAMultiPrimePrivateCrtKeySpecTest method testGetModulus.
//
// Tests for inherited methods
//
/**
* Test for <code>getModulus()</code> method<br>
* Assertion: returns modulus
*/
public final void testGetModulus() {
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.getModulus()));
}
use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project j2objc by google.
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 j2objc by google.
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()));
}
use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project j2objc by google.
the class RSAMultiPrimePrivateCrtKeySpecTest method testGetPrimeP.
/**
* Test for <code>getPrimeP()</code> method<br>
* Assertion: returns prime P
*/
public final void testGetPrimeP() {
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.getPrimeP()));
}
use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project j2objc by google.
the class RSAMultiPrimePrivateCrtKeySpecTest method testIsStatePreserved1.
//
// immutability tests
//
/**
* Tests that internal state of the object
* can not be modified by modifying initial array
*/
public final void testIsStatePreserved1() {
// 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);
// Modify initial array
opi1[2] = new RSAOtherPrimeInfo(BigInteger.ZERO, BigInteger.ZERO, BigInteger.ZERO);
// Check that above modification
// does not affect internal state
assertTrue(checkOtherPrimeInfo(ks.getOtherPrimeInfo()));
}
Aggregations