You are here

public static function ParagonIE_Sodium_Core_Ed25519::publickey in Automatic Updates 7

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

@internal You should not use this directly from another application

Parameters

string $keypair:

Return value

string

Throws

TypeError

1 call to ParagonIE_Sodium_Core_Ed25519::publickey()
ParagonIE_Sodium_Compat::crypto_sign_publickey in vendor/paragonie/sodium_compat/src/Compat.php
Extract an Ed25519 public key from an Ed25519 keypair.

File

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

Class

ParagonIE_Sodium_Core_Ed25519
Class ParagonIE_Sodium_Core_Ed25519

Code

public static function publickey($keypair) {
  if (self::strlen($keypair) !== self::KEYPAIR_BYTES) {
    throw new RangeException('crypto_sign keypair must be 96 bytes long');
  }
  return self::substr($keypair, 64, 32);
}