Diaspora public key published in WebFinger
This commit is contained in:
parent
1076a5e2eb
commit
29ac42addd
plugins/OStatus
@ -1320,6 +1320,8 @@ class OStatusPlugin extends Plugin
|
|||||||
if ($magicsig instanceof Magicsig) {
|
if ($magicsig instanceof Magicsig) {
|
||||||
$xrd->links[] = new XML_XRD_Element_Link(Magicsig::PUBLICKEYREL,
|
$xrd->links[] = new XML_XRD_Element_Link(Magicsig::PUBLICKEYREL,
|
||||||
'data:application/magic-public-key,'. $magicsig->toString());
|
'data:application/magic-public-key,'. $magicsig->toString());
|
||||||
|
$xrd->links[] = new XML_XRD_Element_Link(Magicsig::DIASPORA_PUBLICKEYREL,
|
||||||
|
base64_encode($magicsig->exportPublicKey()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO - finalize where the redirect should go on the publisher
|
// TODO - finalize where the redirect should go on the publisher
|
||||||
|
@ -36,6 +36,7 @@ require_once 'Crypt/RSA.php';
|
|||||||
class Magicsig extends Managed_DataObject
|
class Magicsig extends Managed_DataObject
|
||||||
{
|
{
|
||||||
const PUBLICKEYREL = 'magic-public-key';
|
const PUBLICKEYREL = 'magic-public-key';
|
||||||
|
const DIASPORA_PUBLICKEYREL = 'diaspora-public-key';
|
||||||
|
|
||||||
public $__table = 'magicsig';
|
public $__table = 'magicsig';
|
||||||
|
|
||||||
@ -184,6 +185,12 @@ class Magicsig extends Managed_DataObject
|
|||||||
return 'RSA.' . $mod . '.' . $exp . $private_exp;
|
return 'RSA.' . $mod . '.' . $exp . $private_exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function exportPublicKey($format=CRYPT_RSA_PUBLIC_FORMAT_PKCS1)
|
||||||
|
{
|
||||||
|
$this->publicKey->setPublicKey();
|
||||||
|
return $this->publicKey->getPublicKey($format);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* importKeys will load the object's keypair string, which initiates
|
* importKeys will load the object's keypair string, which initiates
|
||||||
* loadKey() and configures Crypt_RSA objects.
|
* loadKey() and configures Crypt_RSA objects.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user