1
0
mirror of synced 2026-08-05 17:57:15 +00:00

Polish Saml2X509Credential Factories

Issue gh-8789
This commit is contained in:
Josh Cummings
2020-07-20 15:47:58 -06:00
parent 3978cc591f
commit 97ccbe5df2
5 changed files with 237 additions and 91 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ import org.springframework.security.saml2.provider.service.servlet.filter.Saml2W
import static org.springframework.security.saml2.core.Saml2X509Credential.Saml2X509CredentialType.DECRYPTION;
import static org.springframework.security.saml2.core.Saml2X509Credential.Saml2X509CredentialType.SIGNING;
import static org.springframework.security.saml2.core.Saml2X509Credential.Saml2X509CredentialType.VERIFICATION;
import static org.springframework.security.saml2.core.Saml2X509Credential.verification;
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
@@ -107,10 +107,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"V9DQBy2zds9f1I3qxg0eX6JnGrXi/ZiCT+lJgVe3ZFXiejiLAiKB04sXW3ti0LW3\n" +
"lx13Y1YlQ4/tlpgTgfIJxKV6nyPiLoK0nywbMd+vpAirDt2Oc+hk\n" +
"-----END CERTIFICATE-----";
return new Saml2X509Credential(
x509Certificate(certificate),
VERIFICATION
);
return verification(x509Certificate(certificate));
}
private X509Certificate x509Certificate(String source) {