public class XMLObject extends Any
Type=http://www.w3.org/2000/09/xmldsig#Object
(this can be used within a Reference element to identify the
referent's type)Object is an optional element that may occur one
or more times. When present, this element may contain any data.
The Object element may include optional MIME type,
ID, and encoding attributes.
The Object's Encoding attributed may
be used to provide a URI that identifies the method by which the
object is encoded (e.g., a binary file).
The MimeType attribute is an optional attribute
which describes the data within the Object
(independent of its encoding). This is a string with values
defined by [MIME]. For
example, if the Object contains base64 encoded
PNG,
the Encoding may be specified as
'http://www.w3.org/2000/09/xmldsig#base64' and the
MimeType as 'image/png'. This attribute is purely
advisory; no validation of the MimeType information
is required by this specification. Applications which require
normative type and encoding information for signature validation
should specify Transforms with well defined resulting types
and/or encodings.
The Object's Id is commonly
referenced from a Reference in
SignedInfo, or Manifest. This element
is typically used for [enveloping signatures] where the
object being signed is to be included in the signature element.
The digest is calculated over the entire Object element
including start and end tags.
Note, if the application wishes to exclude the
<Object> tags from the digest calculation the
Reference must identify the actual data object (easy
for XML documents) or a transform must be used to remove the
Object tags (likely where the data object is
non-XML). Exclusion of the object tags may be desired for cases
where one wants the signature to remain valid if the data object
is moved from inside a signature to outside the signature (or
vice versa), or where the content of the Object is
an encoding of an original binary document and it is desired to
extract and decode so as to sign the original bitwise
representation.
The following schema fragment specifies the expected content contained within this class.
<complexType name="ObjectType">
<complexContent>
<restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
<sequence maxOccurs="unbounded" minOccurs="0">
<any processContents='lax'/>
</sequence>
<attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
<attribute name="MimeType" type="{http://www.w3.org/2001/XMLSchema}string" />
<attribute name="Encoding" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
</restriction>
</complexContent>
</complexType>
mContext, mElement, mId| Constructor and Description |
|---|
XMLObject(Context aBaglam) |
XMLObject(org.w3c.dom.Element aElement,
Context aContext)
Construct ds:Object from existing
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContentBase64(byte[] aBytes)
Add bytes as base64 to contents
|
java.lang.String |
getEncoding() |
java.lang.String |
getLocalName() |
java.lang.String |
getMIMEType() |
void |
setEncoding(java.lang.String aEncoding) |
void |
setMIMEType(java.lang.String aMIMEType) |
addContent, addContent, addContent, getContentaddBigIntegerElement, addLineBreak, addLineBreak, checkNamespace, createElement, generateAndSetId, getAttribute, getBigIntegerFromElement, getChildText, getContext, getDocument, getElement, getId, getNamespace, insertBase64EncodedElement, insertElement, insertTextElement, selectChildElement, selectChildren, setIdpublic XMLObject(Context aBaglam)
public XMLObject(org.w3c.dom.Element aElement,
Context aContext)
throws XMLSignatureException
aElement - xml elementaContext - according to contextXMLSignatureException - when structure is invalid or can not be
resolved appropriatelypublic java.lang.String getMIMEType()
public void setMIMEType(java.lang.String aMIMEType)
public java.lang.String getEncoding()
public void setEncoding(java.lang.String aEncoding)
public void addContentBase64(byte[] aBytes)
addContentBase64 in class AnyaBytes - that will be added to content/s.public java.lang.String getLocalName()
getLocalName in class BaseElementCopyright © 2025. All rights reserved.