This error message is a bit misleading when called from something other than DSAParameters. Maybe just say "DSA parameters must be integers." instead of explicitly mentioning the class?