1. Import key
gpg --import [key file]
2. Set key trust level
gpg --edit-key [imported key ID]
Enter interactive interface
gpg>
Enter trust
gpg> trust
Answer the trust level according to the prompts
Note:
1) If 1 is executed separately, the key can be imported. You can pass gpg --list-keys See
2) However, if you do not set the key trust level, you will be prompted whether to trust it every time you use the key for encryption. Therefore, you can use the second step to modify the trust level
3) You can also use the local private key to sign the imported secret key to trust the secret key. The command is: gpg --sign-key [imported secret key] Key ID]
4) The secret key ID can be the key’s email address, user name, and hashed hexadecimal value, which can be viewed through gpg --list-keys