Once you have downloaded macOS Sierra.dmg , you need to move the app to your Applications folder: Open the .dmg file. Run the .pkg file inside.
(That sets date to Jan 1, 2017 — the certificate’s valid period)
Avoid "repacks" from torrent sites. They often bypass Gatekeeper, leaving your data vulnerable.
No reputable source offers a "repack" of macOS. If a site advertises one, assume it is unsafe unless proven otherwise (which is nearly impossible).
: Apple provides direct downloads for older OS versions. You can look up the How to download and install macOS guide on official Apple Support to download official disk images ( .dmg ) securely without risking a compromised repack. MacOS Sierra Review
But again — this lowers security.