Esempio n. 1
0
 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()), 'RSA');
     // Instead of choosing a random string, we calculate our GUID from the public key
     // by fingerprint through a sha256 hash.
     $xrd->links[] = new XML_XRD_Element_Link(self::REL_GUID, strtolower($magicsig->toFingerprint()));
 }