Code example for RSAPublicKeySpec

Methods: getPublicExponent

0
        KeySpec ks =
            new RSAPublicKeySpec(null, null);
 
        assertTrue(ks instanceof RSAPublicKeySpec);
    } 
     
    /** 
     * Test for <code>getModulus()</code> method<br> 
     * Assertion: returns modulus 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "getModulus", 
        args = {} 
    ) 
    public final void testGetModulus() { 
        RSAPublicKeySpec rpks =
            new RSAPublicKeySpec(BigInteger.valueOf(1234567890L),
                                 BigInteger.valueOf(3L));
        assertTrue(BigInteger.valueOf(1234567890L).equals(rpks.getModulus()));