private static BigInteger parseMsg(byte[] msg,BigInteger n) throws BadPaddingException {
  BigInteger m=new BigInteger(1,msg);
  if (m.compareTo(n) >= 0) {
    throw new BadPaddingException("Message is larger than modulus");
  }
  return m;
}

private static BigInteger parseMsg ( byte [ ] msg , BigInteger n ) throws BadPaddingException { BigInteger m = new BigInteger ( 1 , msg ) ; if ( m . compareTo ( n ) >= 0 ) { throw new BadPaddingException ( "Message is larger than modulus" ) ; } return m ; }
parse the msg into a biginteger and check against the modulus n .
