if (payload == null) {
throw new IllegalStateException("Payload needs to be set in order to sign the current JWT");
}
setAlgorithm(method.getAlgorithm());
String header = new JWSHeaderWriter().write(new Header(algorithm,
jwkSetUrl,
jsonWebKey,
x509url,
x509CertificateThumbprint,
x509CertificateChain,