private void validate() {
        CommonHelper.assertNotBlank("keystoreAlias", saml2Configuration.getKeyStoreAlias());
        CommonHelper.assertNotBlank("keystoreType", saml2Configuration.getKeyStoreType());
        CommonHelper.assertNotBlank("privateKeyPassword", saml2Configuration.getPrivateKeyPassword());
    }
Generate a self-signed certificate for dn using the provided signature algorithm and key pair.

@param dn       X.500 name to associate with certificate issuer/subject.
@param sigName  name of the signature algorithm to use.
@param sigAlgID algorithm ID associated with the signature algorithm name.
@param keyPair  the key pair to associate with the certificate.
@return an X509Certificate containing the public key in keyPair.
@throws Exception
pac4j-saml/src/main/java/org/pac4j/saml/metadata/keystore/BaseSAML2KeystoreGenerator.java