sodium_crypto_sign_verify_detached

(PHP 7 >= 7.2.0)

sodium_crypto_sign_verify_detachedVerify signature for the message

说明

sodium_crypto_sign_verify_detached ( string $signature , string $msg , string $public_key ) : bool

Warning

本函数还未编写文档,仅有参数列表。

参数

signature

msg

public_key

返回值

add a note add a note

User Contributed Notes 1 note

up
1
Anonymous
5 months ago
<?php

$message
= 'The quick brown fox jumped over the lazy dog.';

# Generate keypair
$keyPair = sodium_crypto_sign_keypair();

# Sign a message
$secKey = sodium_crypto_sign_secretkey($keyPair);
$signature = sodium_crypto_sign_detached($message, $secKey);

# Verify a message
$pubKey = sodium_crypto_sign_publickey($keyPair);
$verifyResult = sodium_crypto_sign_verify_detached($signature, $message, $pubKey);

var_dump($verifyResult); # true or false

?>
To Top