PHP code example of nurtext / signed-request

1. Go to this page and download the library: Download nurtext/signed-request library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nurtext / signed-request example snippets


// Composer autoloader
uest;

// Set a shared secret
SignedRequest::setSharedSecret('my shared secret');

// Encode and hash the data
$signedRequest = SignedRequest::generate(array('hello' => 'world'));

// Debug output
var_dump($signedRequest);

// Just verify, don't return the parsed data
var_dump(SignedRequest::verify($signedRequest));

// Verify and return data if verification succeeds
var_dump(SignedRequest::parse($signedRequest));