com.cedarsoft.crypt.xml
Class XmlSignatureSupport

java.lang.Object
  extended by com.cedarsoft.crypt.xml.XmlSignatureSupport

public class XmlSignatureSupport
extends java.lang.Object

Easy support for xml signatures. Be carefull! The DocumentBuilderFactory has to be namespace aware (DocumentBuilderFactory.setNamespaceAware(boolean)).

Author:
Johannes Schneider (js@cedarsoft.com)

Constructor Summary
XmlSignatureSupport(X509Support x509Support)
          Constructor for XmlSignatureSupport.
 
Method Summary
 org.w3c.dom.Document getOriginalDocument(org.w3c.dom.Document signedDocument)
          getOriginalDocument
 org.w3c.dom.Node getOriginalNode(org.w3c.dom.Document signedDocument)
          Returns the node that is the root node of the original signedDocument
 boolean hasValidSignature(org.w3c.dom.Document doc)
          hasValidSignature
 org.w3c.dom.Document sign(org.w3c.dom.Document xmlDocument)
          sign
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlSignatureSupport

@Inject
public XmlSignatureSupport(@Nonnull
                                  X509Support x509Support)

Constructor for XmlSignatureSupport.

Parameters:
x509Support - a X509Support object.
Method Detail

sign

public org.w3c.dom.Document sign(@Nonnull
                                 org.w3c.dom.Document xmlDocument)

sign

Parameters:
xmlDocument - a Document object.
Returns:
a Document object.

hasValidSignature

public boolean hasValidSignature(@Nonnull
                                 org.w3c.dom.Document doc)
                          throws java.lang.Exception

hasValidSignature

Parameters:
doc - a Document object.
Returns:
a boolean.
Throws:
java.lang.Exception - if any.

getOriginalNode

@Nonnull
public org.w3c.dom.Node getOriginalNode(@Nonnull
                                                org.w3c.dom.Document signedDocument)
Returns the node that is the root node of the original signedDocument

Parameters:
signedDocument - the signed signedDocument
Returns:
the root node of the original signedDocument

getOriginalDocument

@Nonnull
public org.w3c.dom.Document getOriginalDocument(@Nonnull
                                                        org.w3c.dom.Document signedDocument)

getOriginalDocument

Parameters:
signedDocument - a Document object.
Returns:
a Document object.


Copyright © 2011 cedarsoft GmbH. All Rights Reserved.