You are here

public static function ParagonIE_Sodium_Core_Ed25519::keypair in Automatic Updates 8

Same name and namespace in other branches
  1. 7 vendor/paragonie/sodium_compat/src/Core/Ed25519.php \ParagonIE_Sodium_Core_Ed25519::keypair()

@internal You should not use this directly from another application

Return value

string (96 bytes)

Throws

Exception

SodiumException

TypeError

1 call to ParagonIE_Sodium_Core_Ed25519::keypair()
ParagonIE_Sodium_Compat::crypto_sign_keypair in vendor/paragonie/sodium_compat/src/Compat.php
Generate a new random Ed25519 keypair.

File

vendor/paragonie/sodium_compat/src/Core/Ed25519.php, line 23

Class

ParagonIE_Sodium_Core_Ed25519
Class ParagonIE_Sodium_Core_Ed25519

Code

public static function keypair() {
  $seed = random_bytes(self::SEED_BYTES);
  $pk = '';
  $sk = '';
  self::seed_keypair($pk, $sk, $seed);
  return $sk . $pk;
}