I am using vertx.jwt with read-only to validate a given request with a token to my service.
the public key I have is a .pem file starts with -----begin certificate--- and ends with ----end certificate----.
I am using the following options on when creating the provider:
JsonObject providerConfig = new JsonObject().put("public-key",Base64.getEncoder().encode(publicKey.getBytes()));
Where publicKey is a string containing the content of the .pem file.
Upon the creation of the JWTAuth:
JWTAuth provider = JWTAuth.create(vertx, providerConfig);
I receive java.security.spec.InvalidKeySpecException invalid key format
...
at io.vertx.ext.auth.jwt.impl.JWT.<init>(JWT.java:108)
...
caused by sun.security.X509.X509Key.decode
How can I use the read only option for JWT validation?