]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use a real keypair from discovery
authorJames Walker <walkah@walkah.net>
Fri, 26 Feb 2010 04:38:25 +0000 (23:38 -0500)
committerJames Walker <walkah@walkah.net>
Fri, 26 Feb 2010 04:38:25 +0000 (23:38 -0500)
plugins/OStatus/lib/magicenvelope.php

index 4a9efe93d1c83f76132e4e2dc6c094ecad59b537..4f8f8815533faaeeac0afabed535d0be8c3afb09 100644 (file)
@@ -50,7 +50,16 @@ class MagicEnvelope
 
     public function getKeyPair($signer_uri)
     {
-        return 'RSA.79_L2gq-TD72Nsb5yGS0r9stLLpJZF5AHXyxzWmQmlqKl276LEJEs8CppcerLcR90MbYQUwt-SX9slx40Yq3vA==.AQAB.AR-jo5KMfSISmDAT2iMs2_vNFgWRjl5rbJVvA0SpGIEWyPdCGxlPtCbTexp8-0ZEIe8a4SyjatBECH5hxgMTpw==';
+        $disco = new Discovery();
+
+        $links = $disco->lookup($signer_uri);
+        if ($link = Discovery::getService($links, 'magic-public-key')) {
+            list($type, $keypair) = explode(';', $link['href']);
+            return $keypair;
+        }
+
+        throw new Exception('Unable to locate signer public key');
+        //return 'RSA.79_L2gq-TD72Nsb5yGS0r9stLLpJZF5AHXyxzWmQmlqKl276LEJEs8CppcerLcR90MbYQUwt-SX9slx40Yq3vA==.AQAB.AR-jo5KMfSISmDAT2iMs2_vNFgWRjl5rbJVvA0SpGIEWyPdCGxlPtCbTexp8-0ZEIe8a4SyjatBECH5hxgMTpw==';
     }