public NameID decode(final EncryptedID encryptedId,
                         final SamlRegisteredService service,
                         final SamlRegisteredServiceMetadataAdaptor adaptor) {
        try {
            val config = configureDecryptionSecurityConfiguration(service);
            configureKeyDecryptionCredential(adaptor.getEntityId(), adaptor, service, config);
            val parameters = resolveDecryptionParameters(service, config);
            val decrypter = getDecrypter(encryptedId, service, adaptor, parameters);
            return (NameID) decrypter.decrypt(encryptedId);
        } catch (final Throwable e) {
            throw new DecryptionException(e);
        }
    }
Decode name id.

@param encryptedId the encrypted id
@param service     the service
@param adaptor     the adaptor
@return the name id
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/enc/SamlIdPObjectEncrypter.java