Code Monkey home page Code Monkey logo

Comments (3)

Thalhammer avatar Thalhammer commented on July 21, 2024

Can you post a copy of the public key you are trying to load?
Make sure it is a valid PEM Key.
It should look similar to the one here:
https://github.com/Thalhammer/jwt-cpp/blob/master/TokenTest.cpp#L349

from jwt-cpp.

fattah avatar fattah commented on July 21, 2024

It was x.509 base64 encoded certificate file, started with -----BEGIN CERTIFICATE----- and ended with -----END CERTIFICATE-----. I got that cer file from Azure AD single signon app's SAML signing certificate.

I figured out the issue later on. I had to extract the public key first from the certificate file. Then had to use that public key for signature verification. I did that and it worked fine. I had to use following openssl command to extract the public key:

openssl x509 -pubkey -noout -in PublicCertificate.cer > public-key.pub

It solved the issue for me.

Is there any functionality in this app which can be used to do this conversion?

from jwt-cpp.

Thalhammer avatar Thalhammer commented on July 21, 2024

Well you already need to link in openssl anyway, so it should not be a problem to replicate the functionality in the command line tool.
I did not test it, but this should guide you in the right direction I think:
http://fm4dd.com/openssl/certpubkey.htm

from jwt-cpp.

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.