Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elliptic keys not usable #6

Open
jjamor opened this issue Feb 10, 2020 · 1 comment
Open

Elliptic keys not usable #6

jjamor opened this issue Feb 10, 2020 · 1 comment

Comments

@jjamor
Copy link

jjamor commented Feb 10, 2020

We cannot create node with elliptic keys (ES256); it requires RSA keys (but these are heavier for some small devices such as Simatic IOT20xx).

As a workaround, I can patch google-iot-core.js as follows to force usage of ES256 algorithm:

--- google-iot-core.js.orig     2018-01-23 05:24:54.000000000 +0000
+++ google-iot-core.js  2020-02-07 19:13:08.867902125 +0000
@@ -50,7 +50,7 @@
             'exp': Math.round(Date.now() / 1000) + 60 * 60,  // 60 minutes
             'aud': projectId
         };
-        return jwt.sign(token, privateKey, { algorithm: 'RS256' });
+        return jwt.sign(token, privateKey, { algorithm: 'ES256' });
     }

     function MQTTBrokerNode(n) {

However I guess it should be implemented in GUI while editing this node.

@jjamor
Copy link
Author

jjamor commented Feb 10, 2020

This is fixed in node-red-contrib-google-iot-core-custom-auth fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant