Using these instructions from Google Cloud Platform IOT Core website https://cloud.google.com/iot/docs/how-tos/credentials/jwts#iot-core-jwt-java run generates this error:
java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: invalid key format
The method used:
createJwtRsa(String projectId, String privateKeyFile)
The "privateKeyFile" parm is coded: to the file: rsa_private.pem like:
private static final String PRIVATE_KEY_FILE_PATH = "/Volumes/Code/mqtt/nodejs-docs-samples/iot/mqtt_example/rsa_private.pem";
The key was generated following these instructions: https://cloud.google.com/iot/docs/quickstart
Any help to understand how to fix this error would be appreciated.