code: public static JsonWebKey getJwkWithPublicKeyOnly(JsonWebKey jwk) {
          KeyPair publicOnly = jwk.toRSA(false);
          JsonWebKey jsonkeyPublic = JsonWebKey.fromRSA(publicOnly);
          jsonkeyPublic.withKid(jwk.kid());
          jsonkeyPublic.withKeyOps(
                  Arrays.asList(JsonWebKeyOperation.ENCRYPT, JsonWebKeyOperation.WRAP_KEY, JsonWebKeyOperation.VERIFY));
          return jsonkeyPublic;
      }
docs: Converts JsonWebKey with private key to JsonWebKey with public key only.
  
  @param jwk
  JsonWebKey with private key.
  @returns JsonWebKey object with public key only.