Package org.opensaml.saml.metadata.resolver.impl

# Class EntityIDDigestGenerator

java.lang.Object
org.opensaml.saml.metadata.resolver.impl.EntityIDDigestGenerator

All Implemented Interfaces:
  `Function<CriteriaSet,String>`

Direct Known Subclasses:
  `DefaultLocalDynamicSourceKeyGenerator`

public class EntityIDDigestGenerator extends Object implements Function<CriteriaSet,String>
Strategy for processing input criteria to extract the entityID from an `EntityIdCriterion` and produce the digest of the value.

By default the digest strategy used is the SHA-1 algorithm, with output in lower-case hexadecimal. By default, prefix, suffix and value separator are null.

## Field Summary

Fields
Modifier and Type
Field
Description
`private StringDigester`
`digester`
String digester for the EntityDescriptor's entityID.
`private String`
`prefix`
Prefix to prepend to the digested value.
`private String`
`separator`
Common separator between prefix, digested and suffix values.
`private String`
`suffix`
Suffix to append to the digested value.

## Constructor Summary

Constructors
Constructor
Description
`EntityIDDigestGenerator()`
Constructor.
`EntityIDDigestGenerator(StringDigester valueDigester, String keyPrefix, String keySuffix, String valueSeparator)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`apply(CriteriaSet criteria)`
`protected String`
`buildKey(String keyValue)`
Build the key by applying the configured prefix and/or suffix, if present.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.function.Function

`andThen, compose`

## Field Details

### digester

@Nonnull private StringDigester digester
String digester for the EntityDescriptor's entityID.

### prefix

@Nullable private String prefix
Prefix to prepend to the digested value.

### suffix

@Nullable private String suffix
Suffix to append to the digested value.

### separator

@Nullable private String separator
Common separator between prefix, digested and suffix values.

## Constructor Details

### EntityIDDigestGenerator

public EntityIDDigestGenerator()
Constructor.

### EntityIDDigestGenerator

public EntityIDDigestGenerator(@Nullable StringDigester valueDigester, @Nullable String keyPrefix, @Nullable String keySuffix, @Nullable String valueSeparator)
Constructor.

Parameters:
  `valueDigester` - optional digeser for the entityID value
  `keyPrefix` - optional prefix for the digested value
  `keySuffix` - optional suffix for the digested value
  `valueSeparator` - optional separator between the prefix, digest and suffix values

## Method Details

### apply

@Nullable public String apply(@Nullable CriteriaSet criteria)

Specified by:
  `apply` in interface `Function<CriteriaSet,String>`

### buildKey

protected String buildKey(@Nonnull String keyValue)
Build the key by applying the configured prefix and/or suffix, if present.

Parameters:
  `keyValue` - the primary key value data being represented
Returns:
  the key value with prefix and suffix applied