[TASK] Re-work/simplify copyright header in PHP files - Part 9
[Packages/TYPO3.CMS.git] / typo3 / sysext / rsaauth / resources / Private / Php / FrontendLoginRsaPublicKey.php
1 <?php
2 if (!defined('TYPO3_MODE')) {
3 die('Access denied.');
4 }
5
6 /**
7 * This file is part of the TYPO3 CMS project.
8 *
9 * It is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License, either version 2
11 * of the License, or any later version.
12 *
13 * For the full copyright and license information, please read the
14 * LICENSE.txt file that was distributed with this source code.
15 *
16 * The TYPO3 project - inspiring people to share!
17 */
18
19 /** @var \TYPO3\CMS\Rsaauth\Backend\AbstractBackend $backend */
20 $backend = \TYPO3\CMS\Rsaauth\Backend\BackendFactory::getBackend();
21 if ($backend !== NULL) {
22 $keyPair = $backend->createNewKeyPair();
23 $storage = \TYPO3\CMS\Rsaauth\Storage\StorageFactory::getStorage();
24 $storage->put($keyPair->getPrivateKey());
25 session_commit();
26
27 echo $keyPair->getPublicKeyModulus() . ':' . sprintf('%x', $keyPair->getExponent()) . ':';
28 }