Return an encoded message containing the updates,
and an encoded Ed25519 signature of the message.
public verifyUpdate ( SignatureSecretKey $sk, string $challenge ) : array | ||
$sk | SignatureSecretKey | |
$challenge | string | |
리턴 | array |
/** * @route notary/verify */ public function verify() { // Input validation if (empty($_POST['challenge'])) { \Airship\json_response(['status' => 'error', 'message' => 'Expected a challenge=something HTTP POST parameter.']); } if (!\is_string($_POST['challenge'])) { \Airship\json_response(['status' => 'error', 'message' => 'Challenge must be a string.']); } if (Binary::safeStrlen($_POST['challenge']) < 20) { \Airship\json_response(['status' => 'error', 'message' => 'Challenge is too short. Continuum should be generating a long random nonce.']); } try { list($update, $signature) = $this->chanUp->verifyUpdate($this->sk, $_POST['challenge']); \Airship\json_response(['status' => 'OK', 'response' => $update, 'signature' => $signature]); } catch (\Exception $ex) { \Airship\json_response(['status' => 'error', 'message' => $ex->getMessage()]); } }