]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/PublicRSAKey.php
Changes:
[friendica.git] / src / Module / PublicRSAKey.php
index 523ab174fbf785d42995a61e5ead8de3a2d1f299..db99fc50b4fc320768b2039c83a662a84bd46948 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -23,11 +23,9 @@ namespace Friendica\Module;
 
 use Friendica\BaseModule;
 use Friendica\Core\System;
-use Friendica\DI;
 use Friendica\Model\User;
 use Friendica\Network\HTTPException\BadRequestException;
-use Friendica\Util\Crypto;
-use Friendica\Util\Strings;
+use Friendica\Protocol\Salmon;
 
 /**
  * prints the public RSA key of a user
@@ -47,9 +45,10 @@ class PublicRSAKey extends BaseModule
                        throw new BadRequestException();
                }
 
-               Crypto::pemToMe($user['spubkey'], $modulus, $exponent);
-
-               $content = 'RSA' . '.' . Strings::base64UrlEncode($modulus, true) . '.' . Strings::base64UrlEncode($exponent, true);
-               System::httpExit($content, Response::TYPE_BLANK, 'application/magic-public-key');
+               $this->httpExit(
+                       Salmon::salmonKey($user['spubkey']),
+                       Response::TYPE_BLANK,
+                       'application/magic-public-key'
+               );
        }
 }