jdr / jws-ecdsa
ECDSA signers for lcobucci/jwt
Installs: 2 150
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- lcobucci/jwt: ^3.0.4
- mdanter/ecc: ^0.4|^0.5
Requires (Dev)
- phpspec/phpspec: ~3.2
README
ECDSA signers for lcobucci/jwt
.
This library was created in order to support mdanter/ecc
0.4.x in combination with lcobucci/jwt 3.x and will be deprecated once lcobucci/jwt
itself offers support for this version of the mdanter/ecc
library.
Instalation
Require the library with composer:
composer require jdr/jws-ecdsa
Usage
The signers supplied by this library are drop in replacements for the ones supplied by lcobucci/jwt
.
use Lcobucci\JWT\Builder; use Lcobucci\JWT\Signer\Key; use JDR\JWS\ECDSA\ES256; $signer = new ES256(); $privateKey = new Key('file://...'); $token = (new Builder()) ->setIssuedAt(time()) ->setExpiration(time() + 3600) // ... Set additional claims ->sign($signer, $privateKey) ->getToken(); $publicKey = new Key('file://...'); $token->verify($signer, $publicKey);
Credits
License
The MIT License (MIT). Please see License File for more information.