Hactool itself does contain any copyrighted Nintendo code or encryption keys. Instead, it relies on external files to provide those keys. This legal distinction allows the tool to be distributed freely.
Example minimal prod.keys for hactool usage (placeholder values — replace with real keys you extracted): hactool prod.keys does not exist
If you don't want to move the file to a global folder, you can manually point to your keys file using the flag in your command: Hactool itself does contain any copyrighted Nintendo code
After dumping, copy the prod.keys file from your Switch SD card to your computer. The filename must be exactly prod.keys (case-sensitive on Linux/macOS). hactool prod.keys does not exist
Downloading prod.keys from the internet is considered a violation of copyright laws. Always dump keys from your own console to ensure compatibility and legality.