code: public static String generateJWTAssertionFromByteArray(byte[] rsaPrivateKey, String oAuthBasePath, String clientId, String userId, long expiresIn, String scopes) throws IllegalArgumentException, JWTCreationException, IOException {
  		if (expiresIn <= 0L) {
  			throw new IllegalArgumentException("expiresIn should be a non-negative value");
  		}
  		if (rsaPrivateKey == null || rsaPrivateKey.length == 0) {
  			throw new IllegalArgumentException("rsaPrivateKey byte array is empty");
  		}
  		if (oAuthBasePath == null || "".equals(oAuthBasePath) || clientId == null || "".equals(clientId)) {
  			throw new IllegalArgumentException("One of the arguments is null or empty");
  		}
  		
  		RSAPrivateKey privateKey = readPrivateKeyFromByteArray(rsaPrivateKey, "RSA");
  		Algorithm algorithm = Algorithm.RSA256(null, privateKey);
  		long now = System.currentTimeMillis();
  		JWTCreator.Builder builder = JWT.create()
  				.withIssuer(clientId)
  				.withAudience(oAuthBasePath)
  				.withIssuedAt(new Date(now))
  				.withClaim("scope", scopes)
  				.withExpiresAt(new Date(now + expiresIn * 1000));
  		if (userId != null && userId != "") {
  			builder = builder.withSubject(userId);
  		}
  		return builder.sign(algorithm);
  	}
docs: Helper method to create a JWT token for the JWT flow
  @param rsaPrivateKey the byte contents of the RSA private key
  @param oAuthBasePath DocuSign OAuth base path (account-d.docusign.com for the developer sandbox
  and account.docusign.com for the production platform)
  @param clientId DocuSign OAuth Client Id (AKA Integrator Key)
  @param userId DocuSign user Id to be impersonated (This is a UUID)
  @param expiresIn number of seconds remaining before the JWT assertion is considered as invalid
  @param scopes space-separated string that represents the list of scopes to grant to the OAuth token.
  @return a fresh JWT token
  @throws IllegalArgumentException if one of the arguments is invalid
  @throws JWTCreationException if not able to create a JWT token from the input parameters
  @throws IOException if there is an issue with either the public or private file