|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponent
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 void |
doDestroy()
|
protected boolean |
doExecute(DomElementItem item)
Processes a given Item. |
protected void |
doInitialize()
|
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, setId |
| Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponent |
|---|
getId |
| Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent |
|---|
destroy, initialize, isDestroyed, isInitialized |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent |
|---|
destroy, isDestroyed |
| Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiableComponent |
|---|
getId |
| Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent |
|---|
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 valid@Nullable public PublicKey getVerificationKey()
public void setVerificationKey(@Nonnull
PublicKey key)
key - key used to verify the signature@Nullable public Certificate getVerificationCertificate()
public void setVerificationCertificate(@Nonnull
Certificate certificate)
verificationKey with the public key of the certificate.
certificate - certificate containing the key used to verify the signature
protected boolean doExecute(@Nonnull
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(@Nonnull
Element signatureElement)
throws StageProcessingException
signatureElement - the Signature element
StageProcessingException - thrown if the given root element contains more than on signature
protected Element getSignatureElement(@Nonnull
Element root)
throws StageProcessingException
root - root from which to start searching for the signature
StageProcessingException - thrown if there is more than one signature presentprotected void doDestroy()
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent
protected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponentnet.shibboleth.utilities.java.support.component.ComponentInitializationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||