Code example for RSAPublicKey

Methods: getModulus

0
        Key     key) 
    { 
        if (key instanceof RSAPrivateKey)
        { 
            RSAPrivateKey   k = (RSAPrivateKey)key;
 
            return k.getModulus().bitLength();
        } 
        else if (key instanceof RSAPublicKey)
        { 
            RSAPublicKey   k = (RSAPublicKey)key;
 
            return k.getModulus().bitLength();
        } 
 
        throw new IllegalArgumentException("not an RSA key!");
    } 
 
    protected int engineGetOutputSize( 
        int     inputLen) 
    {