Comments (5)
Hi,
A standard JWS simply puts the base 64 encoded signature as the last component of its form. Unfortunately, none of the currently existing JWT libraries support this extension. It is my plan to submit appropriate patches to some of them, but meanwhile, you can construct a valid JWS by hand using the available tests as starting points:`
https://github.com/gamringer/php-pkcs11/blob/master/tests/0163-rsa-sign-pss.phpt
https://github.com/gamringer/php-pkcs11/blob/master/tests/0170-ecdsa.phpt
I would strongly suggest still using a well tested library for validation of those resulting JWTs to avoid numerous often repeated mistakes.
from php-pkcs11.
after a bit further digging, I think it's doable, it's just not in the README. I will see if I can figure it out
from php-pkcs11.
@InfinityMin3r, was my last comment helpful ? Which library are you using for your JWTs ? I'll make sure it's included in my PRs
from php-pkcs11.
Hi @gamringer, worked perfectly. I had to do some modifications to the Spomky Framework in order to get it to work properly. I'm still in the process of hacking the framework to get access to the fields in the JWS before the signature is verified.
Btw, I had to fix a few lines of code to get your library to work on php8.1.
But yes, this library is great! Now I don't have to migrate everything to Java.
Thanks!
from php-pkcs11.
@InfinityMin3r, you're right, the last release that I made was still incompatible with 8.1, but the master branch is already compatible. I should probably address that.
That being said, I am pleased to see that you find this extension helpful.
from php-pkcs11.
Related Issues (20)
- Support C_WaitForSlotEvent() HOT 4
- Support Notify in C_OpenSession
- tests: PHP11_PIN vs PHP11_SOPIN HOT 1
- Segfault when Pkcs11\Module is instanciated inside an included file. HOT 2
- test failures - P11Object HOT 4
- [0.1.1] Seg fault in test suite HOT 22
- 0160-rsa-encrypt-pkcs - segfault with HSM HOT 5
- failed tests due to unsupported C_CreateObject() by HSM
- Module variable going out of scope causes open session to be broken and cause SegFault HOT 5
- Decryption using symmetric key in another function gives CKR_GENERAL_ERROR HOT 14
- How to use in Laravel application? HOT 7
- Internal Server Error (0x00000007/CKR_ARGUMENTS_BAD) PKCS#11 module error: Unable to encrypt [/website/test/***/Hsm.php:119] HOT 2
- Variable types of attributes are not compareable with constants HOT 1
- How To Use On Windows ? HOT 2
- Exception thrown on propietary driver HOT 2
- AWS Cloud HSM Support HOT 2
- Exporting a public key/object from token. HOT 3
- Support AWS CloudHSM SDK 1.1.1 and later HOT 7
- Not login when sign HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-pkcs11.