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

java.lang.Object
  extended by org.jcp.xml.dsig.internal.dom.DOMStructure
      extended by org.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

Constructor Summary
DOMSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, java.util.List references)
          Creates a DOMSignedInfo from the specified parameters.
DOMSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, java.util.List references, java.lang.String id)
          Creates a DOMSignedInfo from the specified parameters.
DOMSignedInfo(org.w3c.dom.Element siElem, XMLCryptoContext context, java.security.Provider provider)
          Creates a DOMSignedInfo from an element.
 
Method Summary
 void canonicalize(XMLCryptoContext context, java.io.ByteArrayOutputStream bos)
           
 boolean equals(java.lang.Object o)
           
 CanonicalizationMethod getCanonicalizationMethod()
          Returns the canonicalization method of this SignedInfo.
 java.io.InputStream getCanonicalizedData()
          Returns the canonicalized signed info bytes after a signing or validation operation.
 java.lang.String getId()
          Returns the optional Id attribute of this SignedInfo.
 java.util.List getReferences()
          Returns an unmodifiable list of one or more References.
 SignatureMethod getSignatureMethod()
          Returns the signature method of this SignedInfo.
 int hashCode()
           
 void marshal(org.w3c.dom.Node parent, java.lang.String dsPrefix, DOMCryptoContext context)
           
 
Methods inherited from class org.jcp.xml.dsig.internal.dom.DOMStructure
isFeatureSupported
 
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
 

Constructor Detail

DOMSignedInfo

public DOMSignedInfo(CanonicalizationMethod cm,
                     SignatureMethod sm,
                     java.util.List 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:
java.lang.NullPointerException - if cm, sm, or references is null
java.lang.IllegalArgumentException - if references is empty
java.lang.ClassCastException - if any of the references are not of type Reference

DOMSignedInfo

public DOMSignedInfo(CanonicalizationMethod cm,
                     SignatureMethod sm,
                     java.util.List references,
                     java.lang.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:
java.lang.NullPointerException - if cm, sm, or references is null
java.lang.IllegalArgumentException - if references is empty
java.lang.ClassCastException - if any of the references are not of type Reference

DOMSignedInfo

public DOMSignedInfo(org.w3c.dom.Element siElem,
                     XMLCryptoContext context,
                     java.security.Provider provider)
              throws MarshalException
Creates a DOMSignedInfo from an element.

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

getCanonicalizationMethod

public CanonicalizationMethod getCanonicalizationMethod()
Description copied from interface: SignedInfo
Returns the canonicalization method of this SignedInfo.

Specified by:
getCanonicalizationMethod in interface SignedInfo
Returns:
the canonicalization method

getSignatureMethod

public SignatureMethod getSignatureMethod()
Description copied from interface: SignedInfo
Returns the signature method of this SignedInfo.

Specified by:
getSignatureMethod in interface SignedInfo
Returns:
the signature method

getId

public java.lang.String getId()
Description copied from interface: SignedInfo
Returns the optional Id attribute of this SignedInfo.

Specified by:
getId in interface SignedInfo
Returns:
the id (may be null if not specified)

getReferences

public java.util.List getReferences()
Description copied from interface: SignedInfo
Returns an unmodifiable list of one or more References.

Specified by:
getReferences in interface SignedInfo
Returns:
an unmodifiable list of one or more References

getCanonicalizedData

public java.io.InputStream getCanonicalizedData()
Description copied from interface: SignedInfo
Returns the canonicalized signed info bytes after a signing or validation operation. This method is useful for debugging.

Specified by:
getCanonicalizedData in interface SignedInfo
Returns:
an InputStream containing the canonicalized bytes, or null if this SignedInfo has not been signed or validated yet

canonicalize

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

marshal

public void marshal(org.w3c.dom.Node parent,
                    java.lang.String dsPrefix,
                    DOMCryptoContext context)
             throws MarshalException
Specified by:
marshal in class DOMStructure
Throws:
MarshalException

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2000-2014 The Apache Software Foundation. All Rights Reserved.