承接 mitoop/signature-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mitoop/signature-sdk

最新稳定版本:v2.4.1

Composer 安装命令:

composer require mitoop/signature-sdk

包简介

README 文档

README

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.

Requirements

  • PHP 7.4 or higher
  • OpenSSL extension enabled

Installation

Install via Composer:

composer require mitoop/signature-sdk

🚀 Quick Start

Signature SDK supports the following signature methods: SHA256-RSA2048, SHA256-HMAC, and ED25519

🔐 Using RSA Signature:

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);

统计信息

  • 总下载量: 46
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-05-01