Search in sources :

Example 11 with RSAMultiPrimePrivateCrtKeySpec

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

Example 12 with RSAMultiPrimePrivateCrtKeySpec

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

Example 13 with RSAMultiPrimePrivateCrtKeySpec

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

Example 14 with RSAMultiPrimePrivateCrtKeySpec

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

Example 15 with RSAMultiPrimePrivateCrtKeySpec

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()));
}
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