public String jwt() throws JOSEException {
        if (jwtCreds instanceof JwtSecretCreds) {
            return jwtHS256((JwtSecretCreds) jwtCreds);
        } else {
            return jwtRS256((JwtPrivateKeyCreds) jwtCreds);
        }
    }
@Test
    void jwtPrivateKey() throws Exception {
        KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
        keyPairGenerator.initialize(2048);
        byte[] randomBytes = new byte[32];
        new SecureRandom().nextBytes(randomBytes);
        KeyPair keyPair = keyPairGenerator.generateKeyPair();
        String jwt = new JwtGenerator(new JwtPrivateKeyCreds(keyPair.getPrivate(), "nick",
                "subject", 120)).jwt();
        JWSVerifier verifier = new RSASSAVerifier((RSAPublicKey) keyPair.getPublic());
        SignedJWT signedJWT = SignedJWT.parse(jwt);
        Assertions.assertTrue(signedJWT.verify(verifier));
    }