Search in sources :

Example 6 with RSAMultiPrimePrivateCrtKeySpec

use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project j2objc by google.

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()));
}
Also used : RSAMultiPrimePrivateCrtKeySpec(java.security.spec.RSAMultiPrimePrivateCrtKeySpec)

Example 7 with RSAMultiPrimePrivateCrtKeySpec

use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project j2objc by google.

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());
}
Also used : RSAMultiPrimePrivateCrtKeySpec(java.security.spec.RSAMultiPrimePrivateCrtKeySpec)

Example 8 with RSAMultiPrimePrivateCrtKeySpec

use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project j2objc by google.

the class RSAMultiPrimePrivateCrtKeySpecTest method testGetPrimeQ.

/**
     * Test for <code>getPrimeQ()</code> method<br>
     * Assertion: returns prime Q
     */
public final void testGetPrimeQ() {
    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.getPrimeQ()));
}
Also used : RSAMultiPrimePrivateCrtKeySpec(java.security.spec.RSAMultiPrimePrivateCrtKeySpec)

Example 9 with RSAMultiPrimePrivateCrtKeySpec

use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project j2objc by google.

the class RSAMultiPrimePrivateCrtKeySpecTest method testGetPrimeExponentP.

/**
     * Test for <code>getPrimeExponentP()</code> method<br>
     * Assertion: returns prime exponent P
     */
public final void testGetPrimeExponentP() {
    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.getPrimeExponentP()));
}
Also used : RSAMultiPrimePrivateCrtKeySpec(java.security.spec.RSAMultiPrimePrivateCrtKeySpec)

Example 10 with RSAMultiPrimePrivateCrtKeySpec

use of java.security.spec.RSAMultiPrimePrivateCrtKeySpec in project robovm by robovm.

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()));
}
Also used : RSAOtherPrimeInfo(java.security.spec.RSAOtherPrimeInfo) RSAMultiPrimePrivateCrtKeySpec(java.security.spec.RSAMultiPrimePrivateCrtKeySpec)

Aggregations

RSAMultiPrimePrivateCrtKeySpec (java.security.spec.RSAMultiPrimePrivateCrtKeySpec)28 KeySpec (java.security.spec.KeySpec)4 RSAOtherPrimeInfo (java.security.spec.RSAOtherPrimeInfo)4 RSAPrivateKeySpec (java.security.spec.RSAPrivateKeySpec)4