Comments (2)
Can you share your code that isn't working as well as what operating system? Are you trying to create a JSON Web Token or JSON Web Key? If you're trying to create a RS256 signed JWT you'll need a PFX file. Here's how that's done (per the readme and comment-based help for New-JsonWebToken):
# Create an RSA-SHA256 signed JWT with a five minute lifetime
$cert = Get-PfxCertificate -FilePath "~/certs/cert.pfx"
$jwt = New-JsonWebToken -Claims @{sub="[email protected]"} -HashAlgorithm SHA256 -Certificate $cert -TimeToLive 300
If you're trying to create a JWK (JSON Web Key) or JWK set, here's how that's done:
# Certificate to be used for all examples below:
$cert = Get-PfxCertificate -FilePath "~/certs/cert.pfx"
# 1. Generate JWK set from certificate with thumbprint A80260EBE2E455429A702E9E6A0FD01C3F902C6B:
$cert | New-JsonWebKeySet
# 2. Generate JSON Web Key from certificate with thumbprint A80260EBE2E455429A702E9E6A0FD01C3F902C6B:
$cert | New-JsonWebKey
# 3. Generate JWK set from certificate with thumbprint A80260EBE2E455429A702E9E6A0FD01C3F902C6B and compress the output:
$cert | New-JsonWebKeySet -Compress
# Create an RSA-SHA256 signed JWT with a five minute lifetime
$cert = Get-PfxCertificate -FilePath "~/certs/cert.pfx"
from psjsonwebtoken.
It might be that I have misinterpreted the use of the JWK / JWT. For now it seems that we will be dropping this. Thank you for explaining
from psjsonwebtoken.
Related Issues (1)
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 psjsonwebtoken.