public class ComputedPersistentIdGenerationStrategy extends AbstractInitializableComponent implements PersistentIdGenerationStrategy
PersistentIdGenerationStrategy that generates a unique ID by computing the hash of
a given attribute value, the entity ID of the inbound message issuer, and a provided salt.| Modifier and Type | Field and Description |
|---|---|
private String |
algorithm
JCE digest algorithm name to use.
|
private org.slf4j.Logger |
log
Class logger.
|
private byte[] |
salt
Salt used when computing the ID.
|
| Constructor and Description |
|---|
ComputedPersistentIdGenerationStrategy()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInitialize() |
String |
generate(String assertingPartyId,
String relyingPartyId,
String principalName,
String sourceId)
Get a Persistent ID that corresponds to the inputs.
|
byte[] |
getSalt()
Get the salt used when computing the ID.
|
void |
setAlgorithm(String alg)
Set the JCE algorithm name of the digest algorithm to use (default is SHA).
|
void |
setEncodedSalt(String newValue)
Set the base64-encoded salt used when computing the ID.
|
void |
setSalt(byte[] newValue)
Set the salt used when computing the ID.
|
destroy, doDestroy, initialize, isDestroyed, isInitialized@Nonnull private final org.slf4j.Logger log
@NonnullAfterInit private byte[] salt
public ComputedPersistentIdGenerationStrategy()
@NonnullAfterInit public byte[] getSalt()
public void setSalt(@Nullable byte[] newValue)
An empty/null input is ignored.
newValue - used when computing the IDpublic void setEncodedSalt(@Nullable String newValue)
An empty/null input is ignored.
newValue - used when computing the IDpublic void setAlgorithm(@Nonnull@NotEmpty String alg)
alg - JCE message digest algorithmprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationException@Nonnull @NotEmpty public String generate(@Nonnull@NotEmpty String assertingPartyId, @Nonnull@NotEmpty String relyingPartyId, @Nonnull@NotEmpty String principalName, @Nonnull@NotEmpty String sourceId) throws SAMLException
This may be generated directly from the inputs or retrieved from some other source.
generate in interface PersistentIdGenerationStrategyassertingPartyId - the asserting party providing the identifierrelyingPartyId - the relying party for whom we're obtaining the identifierprincipalName - name of the subjectsourceId - an underlying identifier for the subjectSAMLException - if an error occurs generating the identifierCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.