with salt.utils.files.fopen(pubkeyfn, 'w') as fic:
            fic.write(salt.utils.stringutils.to_str(_file_or_content(pub_key)))