PHPackages                             yakeing/php\_jwsign - 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. [Security](/categories/security)
4. /
5. yakeing/php\_jwsign

AbandonedArchivedSymfony-bundle[Security](/categories/security)

yakeing/php\_jwsign
===================

This is a class of data encryption and decryption

v1.2.0(6y ago)34322[1 issues](https://github.com/yakeing/php_jwsign/issues)MPL-2.0PHPPHP &gt;=5.6

Since Aug 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/yakeing/php_jwsign)[ Packagist](https://packagist.org/packages/yakeing/php_jwsign)[ Docs](https://github.com/yakeing/php_jwsign)[ RSS](/packages/yakeing-php-jwsign/feed)WikiDiscussions main Synced yesterday

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

Json Wed Sign (RSA)
===================

[](#json-wed-sign-rsa)

This is a function wrapping through the `Openssl` to sign and validate the data, which ensures the integrity and security of the original data.

### Travis CI badge

[](#travis-ci-badge)

[![Travis-ci](https://camo.githubusercontent.com/35dff58af995ef3a82389bf5bd95be64c2d0f5df428f8e84a955b837c08e0bc8/68747470733a2f2f6170692e7472617669732d63692e636f6d2f79616b65696e672f7068705f6a777369676e2e7376673f6272616e63683d6d61696e)](https://travis-ci.com/yakeing/php_jwsign)

### codecov badge

[](#codecov-badge)

[![codecov](https://camo.githubusercontent.com/37351a992dfd70db0475cfcdde49f6c553700e532dacedbdaf59e400ba444855/68747470733a2f2f636f6465636f762e696f2f67682f79616b65696e672f7068705f6a777369676e2f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/yakeing/php_jwsign)

### Github badge

[](#github-badge)

[![Downloads](https://camo.githubusercontent.com/09e73c5d95ed8d3bbbea31088314a28a0d901725d91451706faa38c12656fef8/68747470733a2f2f342e76657263656c2e6170702f6769746875622f646f776e6c6f6164732f79616b65696e672f7068705f6a777369676e3f69636f6e3d676974687562)](../../)[![Size](https://camo.githubusercontent.com/8155083ff6abe1cd5303bc0275ae2dd19b4ace39a247c6b590f0198ac397e97d/68747470733a2f2f342e76657263656c2e6170702f6769746875622f73697a652f79616b65696e672f7068705f6a777369676e3f69636f6e3d676974687562)](src)[![tag](https://camo.githubusercontent.com/4a236a66e76b593267f1d9631d8a79ee4bb23c38545982b9eb1e75b924ed7eb3/68747470733a2f2f342e76657263656c2e6170702f6769746875622f7461672f79616b65696e672f7068705f6a777369676e3f69636f6e3d676974687562)](../../releases)[![license](https://camo.githubusercontent.com/904c4bcc21898764c7b6b7edfba26ea0d5427757cfaee2837ee7bed32124b40b/68747470733a2f2f342e76657263656c2e6170702f7374617469632f6c6963656e73652f3535352f4d504c2d322e302f6665376433373f69636f6e3d676974687562)](LICENSE)[![languages](https://camo.githubusercontent.com/5275888fd9cd7a7b85d47b803d247819aa953b27342dfa420173152309ab1a18/68747470733a2f2f342e76657263656c2e6170702f7374617469632f6c616e67756167652f3535352f5048502f3334616265663f69636f6e3d676974687562)](../../search?l=php)

### Installation

[](#installation)

Use [Composer](https://getcomposer.org) to install the library. Of course, You can go to [Packagist](https://packagist.org/packages/yakeing/php_jwsign) to view.

```

    $ composer require yakeing/php_jwsign

```

### JWSign init

[](#jwsign-init)

```
    $jwsign = new jwsign();
    $jwsign->SetPrivate($accesskey);
```

### Get Pubkey

[](#get-pubkey)

```
    $Pubkey = $jwsign->GetPubkey();

    var_dump($Pubkey);
    array(3) {
        ["pub"]=>string(451) "-----BEGIN PUBLIC KEY-----\nMIIBIjA....NjQIDAQA\n-----END PUBLIC KEY----"
        ["bits"]=>int(2048)
        ["kid"]=>string(43) "cjbdM-CeRfP...5BNYQuksIIgmk"
    }
```

### Sign Message

[](#sign-message)

```
    $Message = base64_encode('
        {
            "method":"pay",
            "charset":"utf-8",
            "version":"1.0",
            "token":"NAM...YgV"
        }
    ');

    $JsonStr = $jwsign->SignMessage($Message);

    var_dump($JsonStr);
    string(557) "{
        "message":"eyJtZXRiO...Z1YifQ==",
        "nonce":"MmlhaDE1MD...MTgwLjEwNDc1OTAw",
        "kid":"cjOdM-CORfPGa...j-0I5BNYQuksIIgmk",
        "sign":"hXvBULK2wSroVFZ...-HYHG7l8Epixikg"
        }"
```

### Pubkey Verify

[](#pubkey-verify)

```
    $value = '{
        "message":"eyJtZXRiO...Z1YifQ==",
        "nonce":"MmlhaDE1MD...MTgwLjEwNDc1OTAw",
        "kid":"cjOdM-CORfPGa...j-0I5BNYQuksIIgmk"
        }';
    $sign = 'hXvBULK2wvSroVFZ...-HKbHGDYHG7l8Epixikg';
    $pub = '-----BEGIN PUBLIC KEY-----\nMIIBIjA....NjQIDAQA\n-----END PUBLIC KEY----';

    $Str = $jwsign->PubkeyVerify($value, $sign, $pub);

    var_dump($Str);
    bool(true)
```

### Get Message

[](#get-message)

```
    $value = '{
        "message":"eyJtZXRiO...Z1YifQ==",
        "nonce":"MmlhaDE1MD...MTgwLjEwNDc1OTAw",
        "kid":"cjOdM-CORfPGa...j-0I5BNYQuksIIgmk"
        }';
    $Str = json_decode($value, true);

    var_dump(base64_decode($Str['message']));
    string(100) "{
            "method":"pay",
            "charset":"utf-8",
            "version":"1.0",
            "token":"NAM...YgV"
        }"
```

[Sponsor](https://github.com/yakeing/Documentation/blob/master/Sponsor/README.md)
---------------------------------------------------------------------------------

[](#sponsor)

If you've got value from any of the content which I have created, then I would very much appreciate your support by payment donate.

[![Sponsor](https://camo.githubusercontent.com/8bf9004e5f53d2223ce47ceeed603c32154d9e6afa76039dd117bf91c5c1a685/68747470733a2f2f342e76657263656c2e6170702f7374617469632f53706f6e736f722f4541344141413f69636f6e3d6865617274)](https://github.com/yakeing/Documentation/blob/master/Sponsor/README.md)

Author
------

[](#author)

weibo: [yakeing](https://weibo.com/yakeing)

twitter: [yakeing](https://twitter.com/yakeing)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

2472d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/95aaf19e492f95c5180360b25e7197ff554625372973f3555b9792a07d5cb9f2?d=identicon)[yakeing](/maintainers/yakeing)

---

Top Contributors

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

---

Tags

decryptionencryptionopensslrsa-algorithmencryptionrsaopenssldecryption

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yakeing-php-jwsign/health.svg)

```
[![Health](https://phpackages.com/badges/yakeing-php-jwsign/health.svg)](https://phpackages.com/packages/yakeing-php-jwsign)
```

###  Alternatives

[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k434.8M1.3k](/packages/phpseclib-phpseclib)[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[vlucas/pikirasa

PKI public/private RSA key encryption using the OpenSSL extension

104101.1k1](/packages/vlucas-pikirasa)[nzo/url-encryptor-bundle

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

961.0M2](/packages/nzo-url-encryptor-bundle)[mmeyer2k/dcrypt

A petite library of encryption functionality for PHP

98727.2k1](/packages/mmeyer2k-dcrypt)[acmephp/core

Raw implementation of the ACME protocol in PHP

38973.7k7](/packages/acmephp-core)

PHPackages © 2026

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