PHPackages                             lake/larke-jwt-sm2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. lake/larke-jwt-sm2

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

lake/larke-jwt-sm2
==================

A JWT Signer library with SM2 and SM3.

1.0.1(2y ago)14Apache-2.0PHP

Since Oct 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/deatil/larke-jwt-sm2)[ Packagist](https://packagist.org/packages/lake/larke-jwt-sm2)[ Docs](https://github.com/deatil/larke-jwt-sm2)[ RSS](/packages/lake-larke-jwt-sm2/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

JWT SM2 驱动
==========

[](#jwt-sm2-驱动)

larke-jwt 库的 SM2 和 SM3 驱动

项目介绍
----

[](#项目介绍)

- 基于 `lpilp/guomi` 的 `larke-jwt` 的 SM2 驱动，同时适配 larke-admin 后台管理系统
- 使用 `SM2` 和 `SM3` 作为 JWT 的验证驱动
- JWT 配置标识为 `GmSM2` 和 `GmSM3`
- 使用 `SM3` 需要 `openssl` 支持 `SM3` 版本

环境要求
----

[](#环境要求)

- PHP &gt;= 8.1

安装步骤
----

[](#安装步骤)

1. 下载安装

```
composer require lake/larke-jwt-sm2
```

2. 更改配置文件

```
larkeadmin.jwt.signer.algorithm = 'GmSM2'
larkeadmin.jwt.signer.private_key = 'sm2/path/prikey.pem'
larkeadmin.jwt.signer.public_key = 'sm2/path/pubkey.pem'
```

和

```
larkeadmin.jwt.signer.algorithm = 'GmSM3'
larkeadmin.jwt.signer.secrect = base64_encode("123123")
```

SM2 字符时使用 HEX 编码的明文私钥和公钥。 使用文件时可使用 PKCS1 和 PKCS8 编码的 PEM 格式的 SM2 私钥，公钥默认只有一种类型。 密钥可查看 `docs/key` 文件夹

开源协议
----

[](#开源协议)

- 本库遵循 `Apache2` 开源协议发布，在保留本系统版权的情况下提供个人及商业免费使用。

版权
--

[](#版权)

- 该系统所属版权归 deatil() 所有。

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

2

Last Release

981d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24578855?v=4)[Deatil](/maintainers/deatil)[@deatil](https://github.com/deatil)

---

Top Contributors

[![deatil](https://avatars.githubusercontent.com/u/24578855?v=4)](https://github.com/deatil "deatil (10 commits)")

---

Tags

jwtjwt-sm2jwt-sm3larke-adminlaraveladminsm2lakelarkelarke-jwt

### Embed Badge

![Health badge](/badges/lake-larke-jwt-sm2/health.svg)

```
[![Health](https://phpackages.com/badges/lake-larke-jwt-sm2/health.svg)](https://phpackages.com/packages/lake-larke-jwt-sm2)
```

###  Alternatives

[lake/larke-admin

An admin api library with JWT and RBAC.

3226.8k5](/packages/lake-larke-admin)[klaravel/ntrust

Role-Based Permissions for Laravel 5.3+

10026.8k1](/packages/klaravel-ntrust)[smarch/watchtower

Front-end for the Shinboi Auth system of Users / Roles / Permissions in Laravel 5

523.0k](/packages/smarch-watchtower)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
