⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.78
Server IP:
13.127.59.50
Server:
Linux ip-172-31-46-210 5.15.0-1033-aws #37~20.04.1-Ubuntu SMP Fri Mar 17 11:39:30 UTC 2023 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.3-4ubuntu2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
uaclient
/
View File Name :
gpg.py
import logging import os import shutil from uaclient import exceptions def export_gpg_key(source_keyfile: str, destination_keyfile: str) -> None: """Copy a specific key from source_keyring_dir into destination_keyfile :param source_keyfile: Path of source keyring file to export. :param destination_keyfile: The filename created with the single exported key. :raise UserFacingError: Any GPG errors or if specific key does not exist in the source_keyring_file. """ logging.debug("Exporting GPG key %s", source_keyfile) if not os.path.exists(source_keyfile): raise exceptions.UserFacingError( "GPG key '{}' not found.".format(source_keyfile) ) shutil.copy(source_keyfile, destination_keyfile) os.chmod(destination_keyfile, 0o644)