PHP code example of langleyfoxall / php-rsa-signer
1. Go to this page and download the library: Download langleyfoxall/php-rsa-signer 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/ */
// Instantiate with private key
$signer = Signer($privateKey);
// Instantiate with private key, and specific key type
$signer = Signer($xmlPrivateKey, RSA::PRIVATE_FORMAT_XML);
// Get binary signature
$base64Signature = $signer->getSignature($json);
// Get base 64 Signature
$base64Signature = $signer->getBase64Signature($json);
// Get base 64 signature, using custom options for JSON encoding
$base64Signature = $signer
->setJsonEncodingOptions(JSON_UNESCAPED_SLASHES)
->getBase64Signature($json);
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.