|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.shibboleth.metadata.pipeline.AbstractComponent
net.shibboleth.metadata.pipeline.BaseStage<ItemType>
net.shibboleth.metadata.pipeline.BaseIteratingStage<DomElementItem>
net.shibboleth.metadata.dom.XMLSignatureValidationStage
@ThreadSafe public class XMLSignatureValidationStage
A pipeline stage which validates the XML digital signature found on DOM Elements.
This stage requires the following properties be set prior to initialization:
verificationKeysignatureRequired, and an Element does not contain a signature than
an ErrorStatus object is set on the Element.
If Element signatures are required to be valid, per isValidSignatureRequired(), and an Element signature is
found to be invalid than an ErrorStatus object is set on the element. If signatures are not required to be
valid and an Element signature is found to be invalid than an WarningStatus is set on the Element.
| Field Summary | |
|---|---|
private Logger |
log
Class logger. |
private boolean |
signatureRequired
Whether Elements are required to be signed. |
private boolean |
validSignatureRequired
Whether the signature on a Elements is required to be valid. |
private Certificate |
verificationCertificate
Certificate whose public key is used to verify the Element signature. |
private PublicKey |
verificationKey
Public key used to verify the Element signature. |
| Constructor Summary | |
|---|---|
XMLSignatureValidationStage()
|
|
| Method Summary | |
|---|---|
protected boolean |
doExecute(DomElementItem item)
Processes a given Item. |
protected void |
doInitialize()
Do the initialization of the component. |
protected Element |
getSignatureElement(Element root)
Gets the signature element from the document. |
Certificate |
getVerificationCertificate()
Gets the certificate whose public key is used to verify the signed Element. |
PublicKey |
getVerificationKey()
Gets the key used to verify the signature. |
boolean |
isSignatureRequired()
Gets whether the Element is required to be signed. |
boolean |
isValidSignatureRequired()
Gets whether the signature on a Element element is required to be valid. |
void |
setSignatureRequired(boolean required)
Sets whether the Element is required to be signed. |
void |
setValidSignatureRequired(boolean isRequired)
Sets whether the signature on a Element element is required to be valid. |
void |
setVerificationCertificate(Certificate certificate)
Set the key, included in a certificate, used to verify the signature. |
void |
setVerificationKey(PublicKey key)
Sets the key used to verify the signature. |
protected boolean |
signatureVerified(Element signatureElement)
Verifies the enclosed signature on the root of the Element. |
| Methods inherited from class net.shibboleth.metadata.pipeline.BaseIteratingStage |
|---|
doExecute |
| Methods inherited from class net.shibboleth.metadata.pipeline.BaseStage |
|---|
execute |
| Methods inherited from class net.shibboleth.metadata.pipeline.AbstractComponent |
|---|
equals, getId, getInitializationInstant, hashCode, initialize, isInitialized, setId |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.shibboleth.metadata.pipeline.Component |
|---|
getId, getInitializationInstant, initialize, isInitialized |
| Field Detail |
|---|
private final Logger log
private boolean signatureRequired
private boolean validSignatureRequired
true
private Certificate verificationCertificate
private PublicKey verificationKey
| Constructor Detail |
|---|
public XMLSignatureValidationStage()
| Method Detail |
|---|
public boolean isSignatureRequired()
public void setSignatureRequired(boolean required)
required - whether the Element is required to be signedpublic boolean isValidSignatureRequired()
public void setValidSignatureRequired(boolean isRequired)
isRequired - whether the signature on a Element element is required to be validpublic PublicKey getVerificationKey()
public void setVerificationKey(PublicKey key)
key - key used to verify the signaturepublic Certificate getVerificationCertificate()
public void setVerificationCertificate(Certificate certificate)
verificationKey with the public key of the certificate.
certificate - certificate containing the key used to verify the signature
protected boolean doExecute(DomElementItem item)
throws StageProcessingException
doExecute in class BaseIteratingStage<DomElementItem>item - Item on which to operate
StageProcessingException - thrown if there is a problem with the stage processing
protected boolean signatureVerified(Element signatureElement)
throws StageProcessingException
signatureElement - the Signature element
StageProcessingException - thrown if the given root element contains more than on signature
protected Element getSignatureElement(Element root)
throws StageProcessingException
root - root from which to start searching for the signature
StageProcessingException - thrown if there is more than one signature present
protected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractComponentComponentInitializationException - throw if there is a problem initializing the component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||