Class DOMSignedInfo
- java.lang.Object
-
- org.apache.jcp.xml.dsig.internal.dom.BaseStructure
-
- org.apache.jcp.xml.dsig.internal.dom.DOMStructure
-
- 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
Fields Modifier and Type Field Description static int
MAXIMUM_REFERENCE_COUNT
The maximum number of references per Manifest, if secure validation is enabled.
-
Constructor Summary
Constructors Constructor Description DOMSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List<? extends Reference> references)
Creates aDOMSignedInfo
from the specified parameters.DOMSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List<? extends Reference> references, String id)
Creates aDOMSignedInfo
from the specified parameters.DOMSignedInfo(Element siElem, XMLCryptoContext context, Provider provider)
Creates aDOMSignedInfo
from an element.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 aDOMSignedInfo
from the specified parameters. Use this constructor when theId
is not specified.- Parameters:
cm
- the canonicalization methodsm
- the signature methodreferences
- the list of references. The list is copied.- Throws:
NullPointerException
- ifcm
,sm
, orreferences
isnull
IllegalArgumentException
- ifreferences
is emptyClassCastException
- if any of the references are not of typeReference
-
DOMSignedInfo
public DOMSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List<? extends Reference> references, String id)
Creates aDOMSignedInfo
from the specified parameters.- Parameters:
cm
- the canonicalization methodsm
- the signature methodreferences
- the list of references. The list is copied.id
- an optional identifer that will allow thisSignedInfo
to be referenced by other signatures and objects- Throws:
NullPointerException
- ifcm
,sm
, orreferences
isnull
IllegalArgumentException
- ifreferences
is emptyClassCastException
- if any of the references are not of typeReference
-
DOMSignedInfo
public DOMSignedInfo(Element siElem, XMLCryptoContext context, Provider provider) throws MarshalException
Creates aDOMSignedInfo
from an element.- Parameters:
siElem
- a SignedInfo element- Throws:
MarshalException
-
-
Method Detail
-
getCanonicalizationMethod
public CanonicalizationMethod getCanonicalizationMethod()
- Specified by:
getCanonicalizationMethod
in interfaceSignedInfo
-
getSignatureMethod
public SignatureMethod getSignatureMethod()
- Specified by:
getSignatureMethod
in interfaceSignedInfo
-
getId
public String getId()
- Specified by:
getId
in interfaceSignedInfo
-
getReferences
public List<Reference> getReferences()
- Specified by:
getReferences
in interfaceSignedInfo
-
getCanonicalizedData
public InputStream getCanonicalizedData()
- Specified by:
getCanonicalizedData
in interfaceSignedInfo
-
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 classDOMStructure
- Throws:
MarshalException
-
getSignedInfoReferences
public static List<Reference> getSignedInfoReferences(SignedInfo si)
-
-