protected PrivateKey getSigningPrivateKey(final SamlRegisteredService registeredService) throws Throwable {
        val samlIdp = casProperties.getAuthn().getSamlIdp();
        val signingKey = samlIdPMetadataLocator.resolveSigningKey(Optional.of(registeredService));
        val privateKeyFactoryBean = new PrivateKeyFactoryBean();
        privateKeyFactoryBean.setLocation(signingKey);
        if (StringUtils.isBlank(registeredService.getSigningKeyAlgorithm())) {
            privateKeyFactoryBean.setAlgorithm(samlIdp.getAlgs().getPrivateKeyAlgName());
        } else {
            privateKeyFactoryBean.setAlgorithm(registeredService.getSigningKeyAlgorithm());
        }
        privateKeyFactoryBean.setSingleton(false);
        LOGGER.debug("Locating signature signing key for [{}] using algorithm [{}]",
            registeredService.getMetadataLocation(), privateKeyFactoryBean.getAlgorithm());
        return privateKeyFactoryBean.getObject();
    }
Gets signing private key.

@param registeredService the registered service
@return the signing private key
@throws Throwable the throwable
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/enc/DefaultSamlIdPObjectSigner.java