public class SignatureValidationFilter extends Object implements MetadataFilter
| Modifier and Type | Field and Description |
|---|---|
private net.shibboleth.utilities.java.support.resolver.CriteriaSet |
defaultCriteria
Set of externally specified default criteria for input to the trust engine.
|
private Logger |
log
Class logger.
|
private boolean |
requireSignature
Indicates whether signed metadata is required.
|
private org.opensaml.xmlsec.signature.support.SignaturePrevalidator |
signaturePrevalidator
Prevalidator for XML Signature instances.
|
private org.opensaml.xmlsec.signature.support.SignatureTrustEngine |
signatureTrustEngine
Trust engine used to validate a signature.
|
| Constructor and Description |
|---|
SignatureValidationFilter(org.opensaml.xmlsec.signature.support.SignatureTrustEngine engine)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected net.shibboleth.utilities.java.support.resolver.CriteriaSet |
buildCriteriaSet(org.opensaml.xmlsec.signature.SignableXMLObject signedMetadata,
String metadataEntryName,
boolean isEntityGroup)
Build the criteria set which will be used as input to the configured trust engine.
|
org.opensaml.core.xml.XMLObject |
filter(org.opensaml.core.xml.XMLObject metadata) |
net.shibboleth.utilities.java.support.resolver.CriteriaSet |
getDefaultCriteria()
Get the set of default criteria used as input to the trust engine.
|
boolean |
getRequireSignature()
Gets whether incoming metadata's root element is required to be signed.
|
protected String |
getRoleIDToken(String entityID,
RoleDescriptor role)
Get a string token for logging/debugging purposes that contains role information and containing entityID.
|
org.opensaml.xmlsec.signature.support.SignaturePrevalidator |
getSignaturePrevalidator()
Get the validator used to perform pre-validation on Signature tokens.
|
org.opensaml.xmlsec.signature.support.SignatureTrustEngine |
getSignatureTrustEngine()
Gets the trust engine used to validate signatures on incoming metadata.
|
protected void |
performPreValidation(org.opensaml.xmlsec.signature.Signature signature,
String metadataEntryName)
Perform pre-validation on the Signature token.
|
protected void |
processEntityDescriptor(EntityDescriptor entityDescriptor)
Process the signatures on the specified EntityDescriptor and any signed children.
|
protected void |
processEntityGroup(EntitiesDescriptor entitiesDescriptor)
Process the signatures on the specified EntitiesDescriptor and any signed children.
|
void |
setDefaultCriteria(net.shibboleth.utilities.java.support.resolver.CriteriaSet newCriteria)
Set the set of default criteria used as input to the trust engine.
|
void |
setRequireSignature(boolean require)
Sets whether incoming metadata's root element is required to be signed.
|
void |
setSignaturePrevalidator(org.opensaml.xmlsec.signature.support.SignaturePrevalidator validator)
Set the validator used to perform pre-validation on Signature tokens.
|
protected void |
verifySignature(org.opensaml.xmlsec.signature.SignableXMLObject signedMetadata,
String metadataEntryName,
boolean isEntityGroup)
Evaluate the signature on the signed metadata instance.
|
private final Logger log
private org.opensaml.xmlsec.signature.support.SignatureTrustEngine signatureTrustEngine
private boolean requireSignature
private net.shibboleth.utilities.java.support.resolver.CriteriaSet defaultCriteria
private org.opensaml.xmlsec.signature.support.SignaturePrevalidator signaturePrevalidator
public SignatureValidationFilter(org.opensaml.xmlsec.signature.support.SignatureTrustEngine engine)
SAMLSignatureProfileValidator.engine - the trust engine used to validate signatures on incoming metadata.@Nonnull public org.opensaml.xmlsec.signature.support.SignatureTrustEngine getSignatureTrustEngine()
@Nullable public org.opensaml.xmlsec.signature.support.SignaturePrevalidator getSignaturePrevalidator()
public void setSignaturePrevalidator(@Nullable org.opensaml.xmlsec.signature.support.SignaturePrevalidator validator)
validator - the signature prevalidator to usepublic boolean getRequireSignature()
true.public void setRequireSignature(boolean require)
true.require - whether incoming metadata is required to be signed@Nullable public net.shibboleth.utilities.java.support.resolver.CriteriaSet getDefaultCriteria()
public void setDefaultCriteria(@Nullable net.shibboleth.utilities.java.support.resolver.CriteriaSet newCriteria)
newCriteria - the new criteria set to usepublic org.opensaml.core.xml.XMLObject filter(org.opensaml.core.xml.XMLObject metadata)
throws FilterException
filter in interface MetadataFilterFilterExceptionprotected void processEntityDescriptor(EntityDescriptor entityDescriptor) throws FilterException
entityDescriptor - the EntityDescriptor to be processedFilterException - thrown if an error occurs during the signature verification process
on the root EntityDescriptor specifiedprotected void processEntityGroup(EntitiesDescriptor entitiesDescriptor) throws FilterException
entitiesDescriptor - the EntitiesDescriptor to be processedFilterException - thrown if an error occurs during the signature verification process
on the root EntitiesDescriptor specifiedprotected void verifySignature(org.opensaml.xmlsec.signature.SignableXMLObject signedMetadata,
String metadataEntryName,
boolean isEntityGroup)
throws FilterException
signedMetadata - the metadata object whose signature is to be verifiedmetadataEntryName - the EntityDescriptor entityID, EntitiesDescriptor Name,
AffiliationDescriptor affiliationOwnerID,
or RoleDescriptor getRoleIDToken(String, RoleDescriptor)
corresponding to the element whose signature is being evaluated.
This is used exclusively for logging/debugging purposes and
should not be used operationally (e.g. for building a criteria set).isEntityGroup - flag indicating whether the signed object is a metadata group (EntitiesDescriptor),
primarily useful for constructing a criteria set for the trust engineFilterException - thrown if the metadata entry's signature can not be established as trusted,
or if an error occurs during the signature verification processprotected void performPreValidation(org.opensaml.xmlsec.signature.Signature signature,
String metadataEntryName)
throws FilterException
signature - the signature to evaluatemetadataEntryName - the EntityDescriptor entityID, EntitiesDescriptor Name,
AffiliationDescriptor affiliationOwnerID,
or RoleDescriptor getRoleIDToken(String, RoleDescriptor)
corresponding to the element whose signature is being evaluated.
This is used exclusively for logging/debugging purposes and
should not be used operationally (e.g. for building a criteria set).FilterException - thrown if the signature element fails pre-validationprotected net.shibboleth.utilities.java.support.resolver.CriteriaSet buildCriteriaSet(org.opensaml.xmlsec.signature.SignableXMLObject signedMetadata,
String metadataEntryName,
boolean isEntityGroup)
signedMetadata - the metadata element whose signature is being verifiedmetadataEntryName - the EntityDescriptor entityID, EntitiesDescriptor Name,
AffiliationDescriptor affiliationOwnerID,
or RoleDescriptor getRoleIDToken(String, RoleDescriptor)
corresponding to the element whose signature is being evaluated.
This is used exclusively for logging/debugging purposes and
should not be used operationally (e.g. for building the criteria set).isEntityGroup - flag indicating whether the signed object is a metadata group (EntitiesDescriptor)protected String getRoleIDToken(String entityID, RoleDescriptor role)
entityID - the containing entityIDrole - the role descriptorCopyright © 1999–2014. All rights reserved.