com.cedarsoft.crypt.xml
Class XmlSignatureSupport

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

public class XmlSignatureSupport
extends 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
 Document getOriginalDocument(Document signedDocument)
          getOriginalDocument
 Node getOriginalNode(Document signedDocument)
          Returns the node that is the root node of the original signedDocument
 boolean hasValidSignature(Document doc)
          hasValidSignature
 Document sign(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(@NotNull
                                  X509Support x509Support)

Constructor for XmlSignatureSupport.

Parameters:
x509Support - a X509Support object.
Method Detail

sign

public Document sign(@NotNull
                     Document xmlDocument)

sign

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

hasValidSignature

public boolean hasValidSignature(@NotNull
                                 Document doc)
                          throws Exception

hasValidSignature

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

getOriginalNode

@NotNull
public Node getOriginalNode(@NotNull
                                    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

@NotNull
public Document getOriginalDocument(@NotNull
                                            Document signedDocument)

getOriginalDocument

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


Copyright © 2010 cedarsoft GmbH. All Rights Reserved.