private KeyPair generateKeyPair() {
        return FunctionUtils.doUnchecked(() -> {
            val generator = KeyPairGenerator.getInstance(keyType);
            generator.initialize(keySize);
            return generator.generateKeyPair();
        });
    }
This is {@link DefaultSamlIdPCertificateAndKeyWriter}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/idp/metadata/writer/DefaultSamlIdPCertificateAndKeyWriter.java