Search in sources :

Example 1 with SelfSignedCertificateGenerator

use of net.shibboleth.utilities.java.support.security.SelfSignedCertificateGenerator in project cas by apereo.

the class TemplatedMetadataAndCertificatesGenerationService method buildSelfSignedEncryptionCert.

/**
     * Build self signed encryption cert.
     *
     * @throws Exception the exception
     */
protected void buildSelfSignedEncryptionCert() throws Exception {
    final SamlIdPProperties idp = casProperties.getAuthn().getSamlIdp();
    final SelfSignedCertificateGenerator generator = new SelfSignedCertificateGenerator();
    generator.setHostName(getIdPHostName());
    generator.setCertificateFile(idp.getMetadata().getEncryptionCertFile().getFile());
    generator.setPrivateKeyFile(idp.getMetadata().getEncryptionKeyFile().getFile());
    generator.setURISubjectAltNames(Arrays.asList(getIdPHostName().concat(URI_SUBJECT_ALTNAME_POSTFIX)));
    generator.generate();
}
Also used : SamlIdPProperties(org.apereo.cas.configuration.model.support.saml.idp.SamlIdPProperties) SelfSignedCertificateGenerator(net.shibboleth.utilities.java.support.security.SelfSignedCertificateGenerator)

Example 2 with SelfSignedCertificateGenerator

use of net.shibboleth.utilities.java.support.security.SelfSignedCertificateGenerator in project cas by apereo.

the class TemplatedMetadataAndCertificatesGenerationService method buildSelfSignedSigningCert.

/**
     * Build self signed signing cert.
     *
     * @throws Exception the exception
     */
protected void buildSelfSignedSigningCert() throws Exception {
    final SamlIdPProperties idp = casProperties.getAuthn().getSamlIdp();
    final SelfSignedCertificateGenerator generator = new SelfSignedCertificateGenerator();
    generator.setHostName(getIdPHostName());
    generator.setCertificateFile(idp.getMetadata().getSigningCertFile().getFile());
    generator.setPrivateKeyFile(idp.getMetadata().getSigningKeyFile().getFile());
    generator.setURISubjectAltNames(Arrays.asList(getIdPHostName().concat(URI_SUBJECT_ALTNAME_POSTFIX)));
    generator.generate();
}
Also used : SamlIdPProperties(org.apereo.cas.configuration.model.support.saml.idp.SamlIdPProperties) SelfSignedCertificateGenerator(net.shibboleth.utilities.java.support.security.SelfSignedCertificateGenerator)

Aggregations

SelfSignedCertificateGenerator (net.shibboleth.utilities.java.support.security.SelfSignedCertificateGenerator)2 SamlIdPProperties (org.apereo.cas.configuration.model.support.saml.idp.SamlIdPProperties)2