class JWTAuthOptionsFactory {

  public JWTAuthOptions createWithGeneratedKeyPair() {
    final KeyPair keypair = generateJwtKeyPair();
    return new JWTAuthOptions()
        .setPermissionsClaimKey(PERMISSIONS)
        .addPubSecKey(
            new PubSecKeyOptions()
                .setAlgorithm(ALGORITHM)
                .setPublicKey(Base64.getEncoder().encodeToString(keypair.getPublic().getEncoded()))
                .setSecretKey(
                    Base64.getEncoder().encodeToString(keypair.getPrivate().getEncoded())));
  }

}