Code example for RSAPrivateKey

Methods: getModulus

0
    protected byte[] engineGetIV()  
    { 
        return null; 
    } 
 
    protected int engineGetKeySize( 
        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();
        }