# GPG-Note

## Import/export key

```bash
gpg --list-keys
gpg --armor --output <public-key-file> --export <ID>
gpg --import <public-key-file>
gpg --keyserver hkp://keys.gnupg.net --search-keys <ID>
```

```bash
gpg --armor --output <private-key-file> --export-secret-keys <ID>
gpg --allow-secret-key-import --import <private-key-file>
gpg --list-secret-keys --keyid-format LONG
```

## Edit passphrase

```bash
gpg --edit-key <ID>
passwd
```

## Git setup gpg sign

> Github add gpg public key

```bash
git config --global commit.gpgsign true
git config --global gpg.program gpg
```

## gpg and git for MAC

```bash
# import keys
gpg2 --list-secret-keys
git config --global gpg.program /usr/local/bin/gpg2
git config --global user.signingkey 987BACA4 
git config --global commit.gpgsign true 
```

Refer [gists](https://gist.github.com/danieleggert/b029d44d4a54b328c0bac65d46ba4c65)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.junyangz.com/note/gpg-tutorial.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
