Skip to content

Commit

Permalink
add key trust
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed Jan 16, 2024
1 parent 9114f52 commit c798531
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,17 @@ async def on_ready():
# prepare gpg
gpg = GPG()

print('Loading GPG keys...')
key_files = glob.glob(os.path.join(GPG_KEY_DIR,'*.asc'))
imported_keys = [gpg.import_keys_file(key_file) for key_file in key_files]

# Trust keys
# Set trust for imported keys
for key in imported_keys:
keyid = key.fingerprints[0]
gpg.trust_keys(keyid, 'TRUST_FULLY')
print(f'GPG key imported and trusted: {keyid}')

# Get the fingerprints of the imported keys
key_fingerprints = [result.fingerprints[0] for result in imported_keys]

Expand Down

0 comments on commit c798531

Please sign in to comment.