Code example for RSAPublicKeySpec

Methods: getModulus

0
     * Test for <code>getModulus()</code> method<br> 
     * Assertion: returns modulus 
     */ 
    public final void testGetModulus() { 
        RSAPublicKeySpec rpks =
            new RSAPublicKeySpec(BigInteger.valueOf(1234567890L),
                                 BigInteger.valueOf(3L));
        assertTrue(BigInteger.valueOf(1234567890L).equals(rpks.getModulus()));
    } 
 
    /** 
     * Test for <code>getPublicExponent()</code> method<br> 
     * Assertion: returns public exponent 
     */ 
    public final void testGetPublicExponent() { 
        RSAPublicKeySpec rpks =
            new RSAPublicKeySpec(BigInteger.valueOf(3L),
                                 BigInteger.valueOf(1234567890L));
        assertTrue(BigInteger.valueOf(1234567890L).equals(rpks.getPublicExponent()));
    } 
Contextual code suggestions in your IDE  Get Codota for Java