Skip to content

bug in MqttExample.java #734

Closed
Closed
@cld2005

Description

@cld2005

In which file did you encounter the issue?

java-docs-samples/iot/api-client/mqtt_example/src/main/java/com/google/cloud/iot/examples/MqttExample.java

Did you change the file? If so, how?

No I did not.

Describe the issue

line 56 KeyFactory kf = KeyFactory.getInstance("RSA256");

this line should be changed to KeyFactory kf = KeyFactory.getInstance("RSA");

https://docs.oracle.com/javase/8/docs/api/java/security/KeyFactory.html

line 110 & line 113

if (options.algorithm == "RSA256") {

} else if (options.algorithm == "ES256") {

should not use "==" to compare strings. use .equals("RSA256") .

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions