Diaspora seeds tend to give the key type in 'type' attribute

This commit is contained in:
Mikael Nordfeldth 2015-06-06 14:46:17 +02:00
parent 57943cad99
commit 623a7eee57

View File

@ -38,8 +38,11 @@ class DiasporaPlugin extends Plugin
public function onEndAttachPubkeyToUserXRD(Magicsig $magicsig, XML_XRD $xrd, Profile $target) 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, $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) public function onPluginVersion(array &$versions)