Search in sources :

Example 6 with OidcProperties

use of org.apereo.cas.configuration.model.support.oidc.OidcProperties in project cas by apereo.

the class OidcDefaultJsonWebKeystoreGeneratorServiceTests method verifyCurve256.

@Test
public void verifyCurve256() throws Exception {
    val properties = new OidcProperties();
    properties.getJwks().getCore().setJwksType("ec");
    properties.getJwks().getCore().setJwksKeySize(256);
    val service = new OidcDefaultJsonWebKeystoreGeneratorService(properties, applicationContext);
    service.generate(new FileSystemResource(KEYSTORE));
    assertTrue(KEYSTORE.exists());
    service.destroy();
}
Also used : lombok.val(lombok.val) OidcProperties(org.apereo.cas.configuration.model.support.oidc.OidcProperties) FileSystemResource(org.springframework.core.io.FileSystemResource) Test(org.junit.jupiter.api.Test)

Example 7 with OidcProperties

use of org.apereo.cas.configuration.model.support.oidc.OidcProperties in project cas by apereo.

the class OidcDefaultJsonWebKeystoreGeneratorServiceTests method verifyCurve384.

@Test
public void verifyCurve384() throws Exception {
    val properties = new OidcProperties();
    properties.getJwks().getCore().setJwksType("ec");
    properties.getJwks().getCore().setJwksKeySize(384);
    val service = new OidcDefaultJsonWebKeystoreGeneratorService(properties, applicationContext);
    service.generate(new FileSystemResource(KEYSTORE));
    assertTrue(KEYSTORE.exists());
}
Also used : lombok.val(lombok.val) OidcProperties(org.apereo.cas.configuration.model.support.oidc.OidcProperties) FileSystemResource(org.springframework.core.io.FileSystemResource) Test(org.junit.jupiter.api.Test)

Example 8 with OidcProperties

use of org.apereo.cas.configuration.model.support.oidc.OidcProperties in project cas by apereo.

the class OidcDefaultJsonWebKeystoreGeneratorServiceTests method verifyCurve521.

@Test
public void verifyCurve521() throws Exception {
    val properties = new OidcProperties();
    properties.getJwks().getCore().setJwksType("ec");
    properties.getJwks().getCore().setJwksKeySize(521);
    val service = new OidcDefaultJsonWebKeystoreGeneratorService(properties, applicationContext);
    service.generate(new FileSystemResource(KEYSTORE));
    assertTrue(KEYSTORE.exists());
    service.destroy();
}
Also used : lombok.val(lombok.val) OidcProperties(org.apereo.cas.configuration.model.support.oidc.OidcProperties) FileSystemResource(org.springframework.core.io.FileSystemResource) Test(org.junit.jupiter.api.Test)

Aggregations

OidcProperties (org.apereo.cas.configuration.model.support.oidc.OidcProperties)8 lombok.val (lombok.val)4 Test (org.junit.jupiter.api.Test)4 Optional (java.util.Optional)3 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)3 FileSystemResource (org.springframework.core.io.FileSystemResource)3 OidcConstants (org.apereo.cas.oidc.OidcConstants)2 OidcRegisteredService (org.apereo.cas.services.OidcRegisteredService)2 Bean (org.springframework.context.annotation.Bean)2 Preconditions (com.google.common.base.Preconditions)1 StandardCharsets (java.nio.charset.StandardCharsets)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 Stream (java.util.stream.Stream)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 Slf4j (lombok.extern.slf4j.Slf4j)1 MessageDigestAlgorithms (org.apache.commons.codec.digest.MessageDigestAlgorithms)1