use of org.opensaml.security.MetadataCredentialResolver in project entcore by opendigitaleducation.
the class SamlValidator method loadSignatureTrustEngine.
private void loadSignatureTrustEngine(String filePath) throws MetadataProviderException {
logger.info(filePath);
FilesystemMetadataProvider metadataProvider = new FilesystemMetadataProvider(new File(filePath));
metadataProvider.setParserPool(new BasicParserPool());
metadataProvider.initialize();
MetadataCredentialResolver metadataCredResolver = new MetadataCredentialResolver(metadataProvider);
KeyInfoCredentialResolver keyInfoCredResolver = Configuration.getGlobalSecurityConfiguration().getDefaultKeyInfoCredentialResolver();
EntityDescriptor entityDescriptor = (EntityDescriptor) metadataProvider.getMetadata();
String entityID = entityDescriptor.getEntityID();
entityDescriptorMap.put(entityID, entityDescriptor);
signatureTrustEngineMap.put(entityID, new ExplicitKeySignatureTrustEngine(metadataCredResolver, keyInfoCredResolver));
}
Aggregations