class SecurityDataService {

    public Optional<String> encryptId(String originalId) {
        String consentKey = RandomStringUtils.random(16, 0, 0, true, true, null, random);

        String compositeConsentId = concatWithSeparator(originalId, consentKey, cryptoProviderHolder.getDefaultDataProvider().getCryptoProviderId());

        byte[] bytesCompositeConsentId = compositeConsentId.getBytes();

        Optional<String> encryptedId = cryptoProviderHolder.getDefaultIdProvider()
                                           .encryptData(bytesCompositeConsentId, serverKey)
                                           .map(EncryptedData::getData)
                                           .map(raw -> Base64.getUrlEncoder().encodeToString(raw))
                                           .map(this::addVersionToEncryptedId);

        if (encryptedId.isEmpty()) {
            log.info("ID: [{}]. Couldn't encrypt ID", originalId);
        }

        return encryptedId;
    }

    @Autowired public  SecurityDataService(Environment environment, CryptoProviderHolder cryptoProviderHolder);

}