[java-plugin-shibd] branch main updated: JSHIBD-25 - Develop necessary CredentialResolvers for SP service
Codeberg
noreply at shibboleth.net
Wed Aug 26 14:52:31 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository java-plugin-shibd.
View the commit online:
https://codeberg.org/Shibboleth/java-plugin-shibd/commit/6acc44636362cc9858dfeaf9cbb3232bfad9e199
The following commit(s) were added to refs/heads/main by this push:
new 6acc446 JSHIBD-25 - Develop necessary CredentialResolvers for SP service
6acc446 is described below
commit 6acc44636362cc9858dfeaf9cbb3232bfad9e199
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Wed Aug 26 10:52:17 2026 -0400
JSHIBD-25 - Develop necessary CredentialResolvers for SP service
https://shibboleth.atlassian.net/browse/JSHIBD-25
Add unit test for hashed entityID and ignoring usage.
---
.../X509CredentialStorageServiceResolverTest.java | 47 ++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/sp-server-impl/src/test/java/net/shibboleth/sp/credential/impl/X509CredentialStorageServiceResolverTest.java b/sp-server-impl/src/test/java/net/shibboleth/sp/credential/impl/X509CredentialStorageServiceResolverTest.java
index c39f6e4..3899c8f 100644
--- a/sp-server-impl/src/test/java/net/shibboleth/sp/credential/impl/X509CredentialStorageServiceResolverTest.java
+++ b/sp-server-impl/src/test/java/net/shibboleth/sp/credential/impl/X509CredentialStorageServiceResolverTest.java
@@ -23,6 +23,7 @@ import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
+import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -162,6 +163,52 @@ public class X509CredentialStorageServiceResolverTest {
buildCriteriaSet("missing-agent", "default", "https://idp.example.org/idp", UsageType.ENCRYPTION));
Assert.assertNull(credential);
}
+
+ @Test
+ public void testOneKeypairByRelyingParty() throws Exception {
+ // Prep directories for IdP.
+ Files.createDirectories(Path.of(testRoot.toString(), "idps", "b845cdeb7baf4e8432d725d4c4f6fb5e90b0eda2"));
+
+ // Generate keypair for testing.
+ generateKeyPair(
+ Path.of(testRoot.toString(), "idps", "b845cdeb7baf4e8432d725d4c4f6fb5e90b0eda2", "sp.key"),
+ Path.of(testRoot.toString(), "idps", "b845cdeb7baf4e8432d725d4c4f6fb5e90b0eda2", "sp.crt"),
+ "localhost", null);
+
+ final FilesystemStorageService storage = new FilesystemStorageService();
+ storage.setId("test");
+ storage.setReadOnly(true);
+ storage.setStorageBase(testRoot.toString());
+ storage.initialize();
+
+ final X509CredentialStorageServiceResolver resolver = new X509CredentialStorageServiceResolver();
+ resolver.setId("test");
+ resolver.setStorageService(storage);
+ resolver.setVelocityEngine(VelocityEngine.newVelocityEngine());
+ resolver.setContextTemplate("idps/$transformedEntityID");
+ resolver.setUsageMap(Map.of(UsageType.SIGNING, "", UsageType.ENCRYPTION, "", UsageType.UNSPECIFIED, ""));
+ resolver.initialize();
+
+ X509Credential credential = (X509Credential) resolver.resolveSingle(
+ buildCriteriaSet("localhost", "default", "https://idp.example.org/idp", UsageType.SIGNING));
+ assert credential != null;
+
+ final PrivateKey key = credential.getPrivateKey();
+ assert key != null;
+
+ final X509Certificate cert = credential.getEntityCertificate();
+ assert cert != null;
+
+ Assert.assertTrue(KeySupport.matchKeyPair(cert.getPublicKey(), key));
+ Assert.assertEquals(cert.getSubjectAlternativeNames(), CollectionSupport.singletonList(
+ CollectionSupport.listOf(Integer.valueOf(2), "localhost")));
+
+ Assert.assertNull(credential.getCRLs());
+
+ credential = (X509Credential) resolver.resolveSingle(
+ buildCriteriaSet("localhost", "default", "https://idp.example.org/idp2", UsageType.ENCRYPTION));
+ Assert.assertNull(credential);
+ }
/**
* Generate a self-signed keypair.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list