org.apache.jcp.xml.dsig.internal.dom
Class DOMSignedInfo

java.lang.Object
  extended by org.apache.jcp.xml.dsig.internal.dom.BaseStructure
      extended by org.apache.jcp.xml.dsig.internal.dom.DOMStructure
          extended by org.apache.jcp.xml.dsig.internal.dom.DOMSignedInfo
All Implemented Interfaces:
SignedInfo, XMLStructure

public final class DOMSignedInfo
extends DOMStructure
implements SignedInfo

DOM-based implementation of SignedInfo.

Author:
Sean Mullan

Field Summary
static int MAXIMUM_REFERENCE_COUNT
          The maximum number of references per Manifest, if secure validation is enabled.
 
Constructor Summary
DOMSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List<? extends Reference> references)
          Creates a DOMSignedInfo from the specified parameters.
DOMSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List<? extends Reference> references, String id)
          Creates a DOMSignedInfo from the specified parameters.
DOMSignedInfo(Element siElem, XMLCryptoContext context, Provider provider)
          Creates a DOMSignedInfo from an element.
 
Method Summary
 void canonicalize(XMLCryptoContext context, ByteArrayOutputStream bos)
           
 boolean equals(Object o)
           
 CanonicalizationMethod getCanonicalizationMethod()
           
 InputStream getCanonicalizedData()
           
 String getId()
           
 List<Reference> getReferences()
           
 SignatureMethod getSignatureMethod()
           
static List<Reference> getSignedInfoReferences(SignedInfo si)
           
 int hashCode()
           
 void marshal(XmlWriter xwriter, String dsPrefix, XMLCryptoContext context)
           
 
Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.BaseStructure
isFeatureSupported, textOfNode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.xml.crypto.XMLStructure
isFeatureSupported
 

Field Detail

MAXIMUM_REFERENCE_COUNT

public static final int MAXIMUM_REFERENCE_COUNT
The maximum number of references per Manifest, if secure validation is enabled.

See Also:
Constant Field Values
Constructor Detail

DOMSignedInfo

public DOMSignedInfo(CanonicalizationMethod cm,
                     SignatureMethod sm,
                     List<? extends Reference> references)
Creates a DOMSignedInfo from the specified parameters. Use this constructor when the Id is not specified.

Parameters:
cm - the canonicalization method
sm - the signature method
references - the list of references. The list is copied.
Throws:
NullPointerException - if cm, sm, or references is null
IllegalArgumentException - if references is empty
ClassCastException - if any of the references are not of type Reference

DOMSignedInfo

public DOMSignedInfo(CanonicalizationMethod cm,
                     SignatureMethod sm,
                     List<? extends Reference> references,
                     String id)
Creates a DOMSignedInfo from the specified parameters.

Parameters:
cm - the canonicalization method
sm - the signature method
references - the list of references. The list is copied.
id - an optional identifer that will allow this SignedInfo to be referenced by other signatures and objects
Throws:
NullPointerException - if cm, sm, or references is null
IllegalArgumentException - if references is empty
ClassCastException - if any of the references are not of type Reference

DOMSignedInfo

public DOMSignedInfo(Element siElem,
                     XMLCryptoContext context,
                     Provider provider)
              throws MarshalException
Creates a DOMSignedInfo from an element.

Parameters:
siElem - a SignedInfo element
Throws:
MarshalException
Method Detail

getCanonicalizationMethod

public CanonicalizationMethod getCanonicalizationMethod()
Specified by:
getCanonicalizationMethod in interface SignedInfo

getSignatureMethod

public SignatureMethod getSignatureMethod()
Specified by:
getSignatureMethod in interface SignedInfo

getId

public String getId()
Specified by:
getId in interface SignedInfo

getReferences

public List<Reference> getReferences()
Specified by:
getReferences in interface SignedInfo

getCanonicalizedData

public InputStream getCanonicalizedData()
Specified by:
getCanonicalizedData in interface SignedInfo

canonicalize

public void canonicalize(XMLCryptoContext context,
                         ByteArrayOutputStream bos)
                  throws XMLSignatureException
Throws:
XMLSignatureException

marshal

public void marshal(XmlWriter xwriter,
                    String dsPrefix,
                    XMLCryptoContext context)
             throws MarshalException
Specified by:
marshal in class DOMStructure
Throws:
MarshalException

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getSignedInfoReferences

public static List<Reference> getSignedInfoReferences(SignedInfo si)

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2000–2014 The Apache Software Foundation. All rights reserved.