| 203 | |
| 204 | |
| 205 | def export_gpg_key(ctx: Context, key_id: str, export_path: pathlib.Path): |
| 206 | keyfile_gpg = export_path.joinpath(GPG_KEY_FILENAME).with_suffix(".gpg") |
| 207 | if keyfile_gpg.exists(): |
| 208 | keyfile_gpg.unlink() |
| 209 | ctx.info(f"Exporting GnuPG Key '{key_id}' to {keyfile_gpg} ...") |
| 210 | ctx.run("gpg", "--output", str(keyfile_gpg), "--export", key_id) |
| 211 | keyfile_pub = export_path.joinpath(GPG_KEY_FILENAME).with_suffix(".pub") |
| 212 | if keyfile_pub.exists(): |
| 213 | keyfile_pub.unlink() |
| 214 | ctx.info(f"Exporting GnuPG Key '{key_id}' to {keyfile_pub} ...") |
| 215 | ctx.run("gpg", "--armor", "--output", str(keyfile_pub), "--export", key_id) |
| 216 | |
| 217 | |
| 218 | def gpg_sign(ctx: Context, key_id: str, path: pathlib.Path): |