]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Diaspora/DiasporaPlugin.php
Diaspora seeds tend to give the key type in 'type' attribute
[quix0rs-gnu-social.git] / plugins / Diaspora / DiasporaPlugin.php
index 1490fce7a31ca9d5d0607f2fde5311cfe8a7d264..ae5fb2f73afbc7e76111b082ab32eff96d22cfb9 100644 (file)
@@ -38,8 +38,11 @@ class DiasporaPlugin extends Plugin
 
     public function onEndAttachPubkeyToUserXRD(Magicsig $magicsig, XML_XRD $xrd, Profile $target)
     {
+        // So far we've only handled RSA keys, but it can change in the future,
+        // so be prepared. And remember to change the statically assigned type attribute below!
+        assert($magicsig->publicKey instanceof Crypt_RSA);
         $xrd->links[] = new XML_XRD_Element_Link(self::REL_PUBLIC_KEY,
-                                    base64_encode($magicsig->exportPublicKey()));
+                                    base64_encode($magicsig->exportPublicKey()), 'RSA');
     }
 
     public function onPluginVersion(array &$versions)