- java.lang.Object
-
- 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.
-
-
Field Summary
Fields Modifier and Type Field Description static intMAXIMUM_REFERENCE_COUNTThe 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 aDOMSignedInfofrom the specified parameters.DOMSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List<? extends Reference> references, String id)Creates aDOMSignedInfofrom the specified parameters.DOMSignedInfo(Element siElem, XMLCryptoContext context, Provider provider)Creates aDOMSignedInfofrom an element.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcanonicalize(XMLCryptoContext context, ByteArrayOutputStream bos)booleanequals(Object o)CanonicalizationMethodgetCanonicalizationMethod()InputStreamgetCanonicalizedData()StringgetId()List<Reference>getReferences()SignatureMethodgetSignatureMethod()static List<Reference>getSignedInfoReferences(SignedInfo si)inthashCode()voidmarshal(Node parent, String dsPrefix, DOMCryptoContext context)-
Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.DOMStructure
equalsContent, 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
-
-
-
-
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 aDOMSignedInfofrom the specified parameters. Use this constructor when theIdis not specified.- Parameters:
cm- the canonicalization methodsm- the signature methodreferences- the list of references. The list is copied.- Throws:
NullPointerException- ifcm,sm, orreferencesisnullIllegalArgumentException- ifreferencesis emptyClassCastException- if any of the references are not of typeReference
-
DOMSignedInfo
public DOMSignedInfo(CanonicalizationMethod cm, SignatureMethod sm, List<? extends Reference> references, String id)
Creates aDOMSignedInfofrom the specified parameters.- Parameters:
cm- the canonicalization methodsm- the signature methodreferences- the list of references. The list is copied.id- an optional identifier that will allow thisSignedInfoto be referenced by other signatures and objects- Throws:
NullPointerException- ifcm,sm, orreferencesisnullIllegalArgumentException- ifreferencesis emptyClassCastException- if any of the references are not of typeReference
-
DOMSignedInfo
public DOMSignedInfo(Element siElem, XMLCryptoContext context, Provider provider) throws MarshalException
Creates aDOMSignedInfofrom an element.- Parameters:
siElem- a SignedInfo element- Throws:
MarshalException
-
-
Method Detail
-
getCanonicalizationMethod
public CanonicalizationMethod getCanonicalizationMethod()
- Specified by:
getCanonicalizationMethodin interfaceSignedInfo
-
getSignatureMethod
public SignatureMethod getSignatureMethod()
- Specified by:
getSignatureMethodin interfaceSignedInfo
-
getId
public String getId()
- Specified by:
getIdin interfaceSignedInfo
-
getReferences
public List<Reference> getReferences()
- Specified by:
getReferencesin interfaceSignedInfo
-
getCanonicalizedData
public InputStream getCanonicalizedData()
- Specified by:
getCanonicalizedDatain interfaceSignedInfo
-
canonicalize
public void canonicalize(XMLCryptoContext context, ByteArrayOutputStream bos) throws XMLSignatureException
- Throws:
XMLSignatureException
-
marshal
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException
- Specified by:
marshalin classDOMStructure- Throws:
MarshalException
-
getSignedInfoReferences
public static List<Reference> getSignedInfoReferences(SignedInfo si)
-
-