This method and `put_secret` below look like the old versions before I made my changes for Windows support.