nodejs-kms | js client for Cloud KMS | GCP library
kandi X-RAY | nodejs-kms Summary
kandi X-RAY | nodejs-kms Summary
Google Cloud Key Management Service (KMS) API client for Node.js. A comprehensive list of changes in each version may be found in the CHANGELOG. Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nodejs-kms
nodejs-kms Key Features
nodejs-kms Examples and Code Snippets
Community Discussions
Trending Discussions on nodejs-kms
QUESTION
I am using Google KMS (https://cloud.google.com/kms/) with an asymmetric signing key to sign JSON Web tokens (jwt) in a node.js application.
I am able to create header and payload and with the Google KMS nodejs library (https://github.com/googleapis/nodejs-kms) I can sign the token.
But it seems that the generated token is not valid.
In fact I am doing the following steps to generate a token:
- define jwt-header as object
- jwt-header object to string
- base64url encode jwt-header-string
- define jwt-payload as object
- jwt-payload object to string
- base64url encode jwt-payload-string
- concatenate (header.payload)
- decode string to base64 byte array
- create sha256 hash on byte array
- select asymmetric key from google kms
- use asymmetric key to get the signature byte array
- use base64url encoding on the signature
- build token (header.payload.signature)
This token alway brings the error (invalid signature). See https://jwt.io/
The public key to verify the token:
...ANSWER
Answered 2019-Nov-18 at 15:09In this snippet:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nodejs-kms
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page