Search in sources :

Example 1 with MetadataCredentialResolver

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));
}
Also used : ExplicitKeySignatureTrustEngine(org.opensaml.xml.signature.impl.ExplicitKeySignatureTrustEngine) BasicParserPool(org.opensaml.xml.parse.BasicParserPool) FilesystemMetadataProvider(org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider) MetadataCredentialResolver(org.opensaml.security.MetadataCredentialResolver) KeyInfoCredentialResolver(org.opensaml.xml.security.keyinfo.KeyInfoCredentialResolver) StaticKeyInfoCredentialResolver(org.opensaml.xml.security.keyinfo.StaticKeyInfoCredentialResolver) XSString(org.opensaml.xml.schema.XSString)

Aggregations

FilesystemMetadataProvider (org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider)1 MetadataCredentialResolver (org.opensaml.security.MetadataCredentialResolver)1 BasicParserPool (org.opensaml.xml.parse.BasicParserPool)1 XSString (org.opensaml.xml.schema.XSString)1 KeyInfoCredentialResolver (org.opensaml.xml.security.keyinfo.KeyInfoCredentialResolver)1 StaticKeyInfoCredentialResolver (org.opensaml.xml.security.keyinfo.StaticKeyInfoCredentialResolver)1 ExplicitKeySignatureTrustEngine (org.opensaml.xml.signature.impl.ExplicitKeySignatureTrustEngine)1