WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Compat::crypto_sign_secretkey() public WP 1.0

Extract an Ed25519 secret key from an Ed25519 keypair.

{} It's a method of the class: ParagonIE_Sodium_Compat{}

No Hooks.

Return

String. Secret key

Usage

$result = ParagonIE_Sodium_Compat::crypto_sign_secretkey( $keypair );
$keypair(string) (required)
Keypair

Code of ParagonIE_Sodium_Compat::crypto_sign_secretkey() WP 5.8.2

public static function crypto_sign_secretkey($keypair)
{
    /* Type checks: */
    ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);

    /* Input validation: */
    if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_SIGN_KEYPAIRBYTES) {
        throw new SodiumException('Argument 1 must be CRYPTO_SIGN_KEYPAIRBYTES long.');
    }

    if (self::useNewSodiumAPI()) {
        return sodium_crypto_sign_secretkey($keypair);
    }
    if (self::use_fallback('crypto_sign_secretkey')) {
        return (string) call_user_func('\\Sodium\\crypto_sign_secretkey', $keypair);
    }
    if (PHP_INT_SIZE === 4) {
        return ParagonIE_Sodium_Core32_Ed25519::secretkey($keypair);
    }
    return ParagonIE_Sodium_Core_Ed25519::secretkey($keypair);
}