Class DOMSignedInfo
- java.lang.Object
-
- org.apache.jcp.xml.dsig.internal.dom.DOMStructure
-
- org.apache.jcp.xml.dsig.internal.dom.DOMSignedInfo
-
- All Implemented Interfaces:
javax.xml.crypto.dsig.SignedInfo
,javax.xml.crypto.XMLStructure
public final class DOMSignedInfo extends DOMStructure implements javax.xml.crypto.dsig.SignedInfo
DOM-based implementation of SignedInfo.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5
HMAC - NOT Recommended HMAC-MD5private static java.lang.String
ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5
Signature - NOT Recommended RSAwithMD5private java.io.InputStream
canonData
private javax.xml.crypto.dsig.CanonicalizationMethod
canonicalizationMethod
private java.lang.String
id
private org.w3c.dom.Element
localSiElem
private static org.slf4j.Logger
LOG
static int
MAXIMUM_REFERENCE_COUNT
The maximum number of references per Manifest, if secure validation is enabled.private org.w3c.dom.Document
ownerDoc
private java.util.List<javax.xml.crypto.dsig.Reference>
references
private javax.xml.crypto.dsig.SignatureMethod
signatureMethod
-
Constructor Summary
Constructors Constructor Description DOMSignedInfo(javax.xml.crypto.dsig.CanonicalizationMethod cm, javax.xml.crypto.dsig.SignatureMethod sm, java.util.List<? extends javax.xml.crypto.dsig.Reference> references)
Creates aDOMSignedInfo
from the specified parameters.DOMSignedInfo(javax.xml.crypto.dsig.CanonicalizationMethod cm, javax.xml.crypto.dsig.SignatureMethod sm, java.util.List<? extends javax.xml.crypto.dsig.Reference> references, java.lang.String id)
Creates aDOMSignedInfo
from the specified parameters.DOMSignedInfo(org.w3c.dom.Element siElem, javax.xml.crypto.XMLCryptoContext context, java.security.Provider provider)
Creates aDOMSignedInfo
from an element.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
canonicalize(javax.xml.crypto.XMLCryptoContext context, java.io.ByteArrayOutputStream bos)
boolean
equals(java.lang.Object o)
javax.xml.crypto.dsig.CanonicalizationMethod
getCanonicalizationMethod()
java.io.InputStream
getCanonicalizedData()
java.lang.String
getId()
java.util.List<javax.xml.crypto.dsig.Reference>
getReferences()
javax.xml.crypto.dsig.SignatureMethod
getSignatureMethod()
static java.util.List<javax.xml.crypto.dsig.Reference>
getSignedInfoReferences(javax.xml.crypto.dsig.SignedInfo si)
int
hashCode()
void
marshal(org.w3c.dom.Node parent, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context)
-
Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.DOMStructure
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
-
LOG
private static final org.slf4j.Logger LOG
-
ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5
private static final java.lang.String ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5
Signature - NOT Recommended RSAwithMD5- See Also:
- Constant Field Values
-
ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5
private static final java.lang.String ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5
HMAC - NOT Recommended HMAC-MD5- See Also:
- Constant Field Values
-
references
private java.util.List<javax.xml.crypto.dsig.Reference> references
-
canonicalizationMethod
private javax.xml.crypto.dsig.CanonicalizationMethod canonicalizationMethod
-
signatureMethod
private javax.xml.crypto.dsig.SignatureMethod signatureMethod
-
id
private java.lang.String id
-
ownerDoc
private org.w3c.dom.Document ownerDoc
-
localSiElem
private org.w3c.dom.Element localSiElem
-
canonData
private java.io.InputStream canonData
-
-
Constructor Detail
-
DOMSignedInfo
public DOMSignedInfo(javax.xml.crypto.dsig.CanonicalizationMethod cm, javax.xml.crypto.dsig.SignatureMethod sm, java.util.List<? extends javax.xml.crypto.dsig.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:
java.lang.NullPointerException
- ifcm
,sm
, orreferences
isnull
java.lang.IllegalArgumentException
- ifreferences
is emptyjava.lang.ClassCastException
- if any of the references are not of typeReference
-
DOMSignedInfo
public DOMSignedInfo(javax.xml.crypto.dsig.CanonicalizationMethod cm, javax.xml.crypto.dsig.SignatureMethod sm, java.util.List<? extends javax.xml.crypto.dsig.Reference> references, java.lang.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:
java.lang.NullPointerException
- ifcm
,sm
, orreferences
isnull
java.lang.IllegalArgumentException
- ifreferences
is emptyjava.lang.ClassCastException
- if any of the references are not of typeReference
-
DOMSignedInfo
public DOMSignedInfo(org.w3c.dom.Element siElem, javax.xml.crypto.XMLCryptoContext context, java.security.Provider provider) throws javax.xml.crypto.MarshalException
Creates aDOMSignedInfo
from an element.- Parameters:
siElem
- a SignedInfo element- Throws:
javax.xml.crypto.MarshalException
-
-
Method Detail
-
getCanonicalizationMethod
public javax.xml.crypto.dsig.CanonicalizationMethod getCanonicalizationMethod()
- Specified by:
getCanonicalizationMethod
in interfacejavax.xml.crypto.dsig.SignedInfo
-
getSignatureMethod
public javax.xml.crypto.dsig.SignatureMethod getSignatureMethod()
- Specified by:
getSignatureMethod
in interfacejavax.xml.crypto.dsig.SignedInfo
-
getId
public java.lang.String getId()
- Specified by:
getId
in interfacejavax.xml.crypto.dsig.SignedInfo
-
getReferences
public java.util.List<javax.xml.crypto.dsig.Reference> getReferences()
- Specified by:
getReferences
in interfacejavax.xml.crypto.dsig.SignedInfo
-
getCanonicalizedData
public java.io.InputStream getCanonicalizedData()
- Specified by:
getCanonicalizedData
in interfacejavax.xml.crypto.dsig.SignedInfo
-
canonicalize
public void canonicalize(javax.xml.crypto.XMLCryptoContext context, java.io.ByteArrayOutputStream bos) throws javax.xml.crypto.dsig.XMLSignatureException
- Throws:
javax.xml.crypto.dsig.XMLSignatureException
-
marshal
public void marshal(org.w3c.dom.Node parent, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context) throws javax.xml.crypto.MarshalException
- Specified by:
marshal
in classDOMStructure
- Throws:
javax.xml.crypto.MarshalException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
getSignedInfoReferences
public static java.util.List<javax.xml.crypto.dsig.Reference> getSignedInfoReferences(javax.xml.crypto.dsig.SignedInfo si)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-