@Override
    public <T extends Ticket> T create(final TicketGrantingTicket ticketGrantingTicket,
                                       final Service service,
                                       final boolean credentialProvided,
                                       final Class<T> clazz) throws Throwable {
        val ticketId = produceTicketIdentifier(service, ticketGrantingTicket, credentialProvided);
        var result = FunctionUtils.doIf(cipherExecutor.isEnabled(), () -> {
            LOGGER.trace("Attempting to encode service ticket [{}]", ticketId);
            val encoded = cipherExecutor.encode(ticketId);
            LOGGER.debug("Encoded service ticket id [{}]", encoded);
            return encoded;
        }, () -> ticketId).get();
        return produceTicket(ticketGrantingTicket, service, credentialProvided, result, clazz);
    }
The {@link DefaultServiceTicketFactory} is responsible for
creating {@link ServiceTicket} objects.

@author Misagh Moayyed
@since 4.2
core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/factory/DefaultServiceTicketFactory.java