Giter Site home page Giter Site logo

Using ECDSA/RSA Signing? about php-pkcs11 HOT 5 CLOSED

gamringer avatar gamringer commented on June 5, 2024
Using ECDSA/RSA Signing?

from php-pkcs11.

Comments (5)

gamringer avatar gamringer commented on June 5, 2024 1

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.

InfinityMin3r avatar InfinityMin3r commented on June 5, 2024

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.

gamringer avatar gamringer commented on June 5, 2024

@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.

InfinityMin3r avatar InfinityMin3r commented on June 5, 2024

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.

gamringer avatar gamringer commented on June 5, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.