PHP Classes

File: bin/keygen.php

Recommend this page to a friend!
  Classes of Scott Arciszewski  >  Discretion  >  bin/keygen.php  >  Download  
File: bin/keygen.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Discretion
Show contact forms and deliver encrypted mail
Author: By
Last change:
Date: 4 months ago
Size: 467 bytes
 

Contents

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

use
ParagonIE\Sapient\CryptographyKeys\SigningSecretKey;

$root = \dirname(__DIR__);
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;

For more information send a message to info at phpclasses dot org.