public-square / jwk-multibase-key-converter-php
Enables conversion of multibase strings to/from JWK, limited to secp256k1 and P-384. Additionally, has support for did:key method spec.
Requires
- php: >=8.1
- ext-gmp: *
- public-square/jwt-framework-schnorr: ^0.1.0
- simplito/elliptic-php: ^1.0
- yocto/yoclib-multibase: ^1.1
Requires (Dev)
- captainhook/captainhook: ^5.11
- captainhook/plugin-composer: ^5.3
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9
- symplify/easy-coding-standard: ^11.1
README
Information
This library is a tool to assist in the conversion of Multibase/Multicodec strings and did:key method spec keys to JWK, and vice versa. It utilizes Multibase/Multicodec, Simplito-EC, and JWT Framework to aid in these conversions.
For more information on the did:key spec, please read the current unofficial draft here.
Currently, this libary only supports the following curves:
- secp256k1
- nistp384
OpenSSL and Windows
In order for key generation to work on Windows machines, this Installation documentation must be done correctly, specifically regarding openssl.cnf
.
How It Works
- Public JWK Generation
- Multibase Conversion
- did:key Conversion
- Public JWK Conversion
Requirements
- >= PHP 8.1
- composer
- ext-gmp
Installation
You can install this library via Composer :
composer require public-square/jwk-multibase-key-converter-php
Contribute
Please open a pull request.
License
This software is release under MIT license.