It really helps to know the exact model of the Mac which you can get by entering the system serial number here:
Check Your Service and Support Coverage - Apple Support
It also helps to know the OS that was last used as well as the OS about to be installed.
Many times this error may be due to the installer's certificate being expired. If this is the case, then changing the system date to 2017 should allow the installer to work. Launch the Terminal app from the Utilities menu on the menu bar and use the following command to set the system date & time to Jan. 2, 2017 @ 11:33am:
date -u 010211332017
If there are no errors, then quit the Terminal and select "Reinstall macOS". If the installer is for a really old OS, then you may need to set the date to 2015, or perhaps even earlier.