summaryrefslogtreecommitdiff
path: root/plugins/OStatus/lib/magicenvelope.php
diff options
context:
space:
mode:
authorJames Walker <walkah@walkah.net>2010-02-25 23:38:25 -0500
committerJames Walker <walkah@walkah.net>2010-02-25 23:38:25 -0500
commit855692141d531287b179841b8816e90023b6ba7b (patch)
treee9509073dae594e0d2cec51235d74c59b4476fae /plugins/OStatus/lib/magicenvelope.php
parent0afb09ad64bec9ea7f9569c73899b2c3fbc1e5a5 (diff)
use a real keypair from discovery
Diffstat (limited to 'plugins/OStatus/lib/magicenvelope.php')
-rw-r--r--plugins/OStatus/lib/magicenvelope.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/OStatus/lib/magicenvelope.php b/plugins/OStatus/lib/magicenvelope.php
index 4a9efe93d..4f8f88155 100644
--- a/plugins/OStatus/lib/magicenvelope.php
+++ b/plugins/OStatus/lib/magicenvelope.php
@@ -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==';
}