Generate Key #417
              
                
                  
                  
                    Answered
                  
                  by
                    panva
                  
              
          
                  
                    
                      willyprayogo26
                    
                  
                
                  asked this question in
                Q&A
              
            
            
              Generate Key
            
            #417
          
          
        Replies: 1 comment
-
| import * as jose from 'jose'
const keyPair = await jose.generateKeyPair('ES256')
const jwk = await jose.exportJWK(keyPair.publicKey)
const kid = await jose.calculateJwkThumbprint(jwk)
console.log({
  keys: [
    {
      ...jwk,
      kid,
      use: 'sig',
      alg: 'ES256'
    }
  ]
}) | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        willyprayogo26
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
https://stg-id.singpass.gov.sg/docs/authorization/api#_client_jwk_requirements
How to generate key like this:
Beta Was this translation helpful? Give feedback.
All reactions