Giter VIP home page Giter VIP logo

Comments (4)

cmesas avatar cmesas commented on August 30, 2024 1

Hrm,
On my system, your private key is invalid. If that was generated by vapid, I'm not sure why it made an invalid key, but you can also create one by using openssl directly:
openssl ecparam -genkey -name prime256v1 -noout -out private_key.pem
I'm also not sure why you're seeing the incorrect padding error. I tried the application string and it worked fine.

Thanks, I'll try again as you say.

Thanks, finally without generating the keys through the vapid library I got it to work.

I found these commands that I think could be useful for people who want to work with DER (bas64), I'll leave it here:

openssl ecparam -genkey -name prime256v1 -noout -out private_key.pem
openssl ec -in private_key.pem -pubout -outform DER|tail -c 65|base64|tr -d '=' |tr '/+' '-' >> public.key
openssl ec -in private_key.pem -outform DER|tail -c +8|head -c 32|base64|tr -d '=' |tr '/+' '
-' >> private. key

Thank @jrconlin

from pywebpush.

cmesas avatar cmesas commented on August 30, 2024

@jrconlin any ideas what I may be doing wrong? I am blocked and the only solution I would have would be to integrate in node that I have seen that I have no problem.

from pywebpush.

jrconlin avatar jrconlin commented on August 30, 2024

Hrm,

On my system, your private key is invalid. If that was generated by vapid, I'm not sure why it made an invalid key, but you can also create one by using openssl directly:

openssl ecparam -genkey -name prime256v1 -noout -out private_key.pem

I'm also not sure why you're seeing the incorrect padding error. I tried the application string and it worked fine.

from pywebpush.

cmesas avatar cmesas commented on August 30, 2024

Hrm,

On my system, your private key is invalid. If that was generated by vapid, I'm not sure why it made an invalid key, but you can also create one by using openssl directly:

openssl ecparam -genkey -name prime256v1 -noout -out private_key.pem

I'm also not sure why you're seeing the incorrect padding error. I tried the application string and it worked fine.

Thanks, I'll try again as you say.

from pywebpush.

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.