Code example for RSAPrivateKey

Methods: getModulus

0
    { 
        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) 
    { 
        try