Class DOMSignedInfo
java.lang.Object
org.apache.jcp.xml.dsig.internal.dom.DOMStructure
org.apache.jcp.xml.dsig.internal.dom.DOMSignedInfo
- All Implemented Interfaces:
SignedInfo
,XMLStructure
DOM-based implementation of SignedInfo.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
HMAC - NOT Recommended HMAC-MD5private static final String
Signature - NOT Recommended RSAwithMD5private InputStream
private CanonicalizationMethod
private String
private Element
private static final org.slf4j.Logger
static final int
The maximum number of references per Manifest, if secure validation is enabled.private Document
private SignatureMethod
-
Constructor Summary
ConstructorsConstructorDescriptionDOMSignedInfo
(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
Modifier and TypeMethodDescriptionvoid
canonicalize
(XMLCryptoContext context, ByteArrayOutputStream bos) boolean
getId()
int
hashCode()
void
marshal
(Node parent, String dsPrefix, DOMCryptoContext context) Methods inherited from class org.apache.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
-
Field Details
-
MAXIMUM_REFERENCE_COUNT
public static final int MAXIMUM_REFERENCE_COUNTThe maximum number of references per Manifest, if secure validation is enabled.- See Also:
-
LOG
private static final org.slf4j.Logger LOG -
ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5
Signature - NOT Recommended RSAwithMD5- See Also:
-
ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5
HMAC - NOT Recommended HMAC-MD5- See Also:
-
references
-
canonicalizationMethod
-
signatureMethod
-
id
-
ownerDoc
-
localSiElem
-
canonData
-
-
Constructor Details
-
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 Details
-
getCanonicalizationMethod
- Specified by:
getCanonicalizationMethod
in interfaceSignedInfo
-
getSignatureMethod
- Specified by:
getSignatureMethod
in interfaceSignedInfo
-
getId
- Specified by:
getId
in interfaceSignedInfo
-
getReferences
- Specified by:
getReferences
in interfaceSignedInfo
-
getCanonicalizedData
- Specified by:
getCanonicalizedData
in interfaceSignedInfo
-
canonicalize
public void canonicalize(XMLCryptoContext context, ByteArrayOutputStream bos) throws XMLSignatureException - Throws:
XMLSignatureException
-
marshal
- Specified by:
marshal
in classDOMStructure
- Throws:
MarshalException
-
equals
-
getSignedInfoReferences
-
hashCode
public int hashCode()
-