X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FPublicRSAKey.php;h=810a9210cdbe72f9399590c6a851864065d3bc53;hb=53aba7b37e019d4093d0985e394d393ae77ef0df;hp=7c46b63356c7e89e74090b02d36fd9b501b41934;hpb=122ad0af14f046c2462a03fe33967dc41abfc8b5;p=friendica.git diff --git a/src/Module/PublicRSAKey.php b/src/Module/PublicRSAKey.php index 7c46b63356..810a9210cd 100644 --- a/src/Module/PublicRSAKey.php +++ b/src/Module/PublicRSAKey.php @@ -1,6 +1,6 @@ argc !== 2) { + if (empty($this->parameters['nick'])) { throw new BadRequestException(); } - // @TODO: Replace with parameter from router - $nick = $app->argv[1]; + $nick = $this->parameters['nick']; $user = User::getByNickname($nick, ['spubkey']); if (empty($user) || empty($user['spubkey'])) { throw new BadRequestException(); } - Crypto::pemToMe($user['spubkey'], $modulus, $exponent); - - header('Content-type: application/magic-public-key'); - echo 'RSA' . '.' . Strings::base64UrlEncode($modulus, true) . '.' . Strings::base64UrlEncode($exponent, true); - - exit(); + System::httpExit( + Salmon::salmonKey($user['spubkey']), + Response::TYPE_BLANK, + 'application/magic-public-key' + ); } }