From c77b64baf9694d8a69fea627db28b010b53ceb20 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 15 Feb 2022 16:09:04 +0000 Subject: [PATCH] Base64 encode pgp public key within vcard --- pgp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pgp.py b/pgp.py index c1d8b6e84..317e97fa1 100644 --- a/pgp.py +++ b/pgp.py @@ -8,6 +8,7 @@ __status__ = "Production" __module_group__ = "Profile Metadata" import os +import base64 import subprocess from pathlib import Path from person import get_actor_json @@ -645,7 +646,8 @@ def actor_to_vcard(actor: {}) -> str: vcard_str += 'PHOTO:' + actor['icon']['url'] + '\n' pgp_key = get_pgp_pub_key(actor) if pgp_key: - vcard_str += 'KEY;TYPE=PGP:' + pgp_key + '\n' + vcard_str += 'KEY:data:application/pgp-keys;base64,' + \ + base64.b64encode(pgp_key).decode('utf-8') + '\n' email_address = get_email_address(actor) if email_address: vcard_str += 'EMAIL;TYPE=internet:' + email_address + '\n'