PHP Classes

File: bin/keygen.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   Chronicle   bin/keygen.php   Download  
File: bin/keygen.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Chronicle
Append arbitrary data to a storage container
Author: By
Last change: Boyscouting
Type safety
Minor bugfixes.
Date: 1 year ago
Size: 510 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);

use
ParagonIE\Sapient\CryptographyKeys\SigningSecretKey;

$root = \dirname(__DIR__);
/** @psalm-suppress UnresolvableInclude */
require_once $root . '/cli-autoload.php';

/* This generates a new secret key from your kernel's CSPRNG */
$signingSecretKey = SigningSecretKey::generate();

echo
json_encode(
    [
       
'secret-key' => $signingSecretKey->getString(),
       
'public-key' => $signingSecretKey->getPublicKey()->getString()
    ],
   
JSON_PRETTY_PRINT
), PHP_EOL;