https://github.com/mitoop/signature-sdk
Signature SDK is a framework-agnostic PHP library that provides secure request signing and verification logic. It is the core signing engine used by laravel-signature, but can also be used independently in any PHP project.
https://github.com/mitoop/signature-sdk
Last synced: 7 months ago
JSON representation
Signature SDK is a framework-agnostic PHP library that provides secure request signing and verification logic. It is the core signing engine used by laravel-signature, but can also be used independently in any PHP project.
- Host: GitHub
- URL: https://github.com/mitoop/signature-sdk
- Owner: mitoop
- Created: 2025-03-29T12:39:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-05T15:11:37.000Z (10 months ago)
- Last Synced: 2025-10-05T21:26:11.529Z (9 months ago)
- Language: PHP
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Signature Sdk
Signature SDK is a framework-agnostic PHP library that provides secure request signing and verification logic.
It is the core signing engine used by [laravel-signature](https://github.com/mitoop/laravel-signature).
## Requirements
- PHP 7.4 or higher
- OpenSSL extension enabled
## Installation
Install via Composer:
```bash
composer require mitoop/signature-sdk
```
## 🚀 Quick Start
Signature SDK supports the following signature methods:
**SHA256-RSA2048**, **SHA256-HMAC**, and **ED25519**
#### 🔐 Using RSA Signature:
```php
use Mitoop\SignatureSdk\Client;
use Mitoop\SignatureSdk\RequestSigner;
use Mitoop\SignatureSdk\Signers\RsaSigner;
$privateKey = 'your_rsa_private_key_string';
$publicKey = 'plat_rsa_public_key_string';
$signer = new RsaSigner($privateKey, $publicKey);
$requestSigner = new RequestSigner(
mchid: 'your_merchant_id',
appid: 'your_app_id',
signer: $signer,
platformPrefix: 'MP' // Paltform prefix
);
$client = new Client(
config: [
'base_url' => 'https://api.example.com',
],
signer: $requestSigner
);
$response = $client->post('/v1/pay', [
'amount' => 100,
'currency' => 'USD',
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
```