protected EncryptionParameters resolveEncryptionParameters(final SamlRegisteredService service,
                                                               final BasicEncryptionConfiguration encryptionConfiguration)
        throws ResolverException {
        val criteria = new CriteriaSet();
        criteria.add(new EncryptionConfigurationCriterion(encryptionConfiguration));
        criteria.add(new EncryptionOptionalCriterion(service.isEncryptionOptional()));
        return new BasicEncryptionParametersResolver().resolveSingle(criteria);
    }
Resolve encryption parameters.

@param service                 the service
@param encryptionConfiguration the encryption configuration
@return the encryption parameters
@throws ResolverException the exception
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/enc/SamlIdPObjectEncrypter.java