Class AlgorithmFilter

java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
org.opensaml.saml.metadata.resolver.filter.impl.AlgorithmFilter
All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, MetadataFilter

public class AlgorithmFilter extends AbstractInitializableComponent implements MetadataFilter
A filter that adds algorithm extension content to entities in order to drive software behavior based on them.

The entities to annotate are identified with a Predicate, and multiple algorithms can be associated with each.

  • Field Details

  • Constructor Details

    • AlgorithmFilter

      public AlgorithmFilter()
      Constructor.
  • Method Details

    • setRules

      public void setRules(@Nonnull @NonnullElements Map<Predicate<EntityDescriptor>,Collection<XMLObject>> rules)
      Set the mappings from Predicate to extensions of various types to apply.
      Parameters:
      rules - rules to apply
    • filter

      @Nullable public XMLObject filter(@Nullable XMLObject metadata, @Nonnull MetadataFilterContext context) throws FilterException
      Filters the given metadata, perhaps to remove elements that are not wanted.
      Specified by:
      filter in interface MetadataFilter
      Parameters:
      metadata - the metadata to be filtered.
      context - the metadata filter context
      Returns:
      the filtered XMLObject, which may or may not be the same as the XMLObject instance passed in to the method. Maybe be null, for example if the top-level element was removed by the filter.
      Throws:
      FilterException - thrown if an error occurs during the filtering process
    • filterEntityDescriptor

      protected void filterEntityDescriptor(@Nonnull EntityDescriptor descriptor)
      Filters entity descriptor.
      Parameters:
      descriptor - entity descriptor to filter
    • filterEntitiesDescriptor

      protected void filterEntitiesDescriptor(@Nonnull EntitiesDescriptor descriptor)
      Filters entities descriptor.
      Parameters:
      descriptor - entities descriptor to filter
    • getExtensions

      @Nonnull protected Extensions getExtensions(@Nonnull EntityDescriptor descriptor)
      Return existing Extensions object or create it first.
      Parameters:
      descriptor - the surrounding entity
      Returns:
      new or existing extension block
    • addEncryptionMethod

      protected void addEncryptionMethod(@Nonnull EntityDescriptor descriptor, @Nonnull EncryptionMethod encryptionMethod)
      Add EncryptionMethod extension to every KeyDescriptor found in an entity.
      Parameters:
      descriptor - the entity to modify
      encryptionMethod - extension to add
    • checkDigestMethod

      private void checkDigestMethod(@Nonnull @NotEmpty String uri)
      Check the input method for "known" and "supported" status for logging purposes.
      Parameters:
      uri - input method
    • checkSigningMethod

      private void checkSigningMethod(@Nonnull @NotEmpty String uri)
      Check the input method for "known" and "supported" status for logging purposes.
      Parameters:
      uri - input method
    • checkEncryptionMethod

      private void checkEncryptionMethod(@Nonnull @NotEmpty String uri)
      Check the input method for "known" and "supported" status for logging purposes.
      Parameters:
      uri - input method