public class KeyInfoImpl extends DOMStructure implements KeyInfo
KeyInfo that supports the DOM XML
representation and processing mechanism.DOMStructure.NodeWrapper| Modifier and Type | Field and Description |
|---|---|
protected List |
content_
The content.
|
protected String |
id_
The
Id-attribute value. |
protected String |
localname
The localname of the marshaled element.
|
protected String |
namsepace
The namespace of the marshaled element.
|
implMap_, state_, STATE_CREATED, STATE_MARSHALED, STATE_UNINITIALIZED, STATE_UNMARSHALED| Modifier | Constructor and Description |
|---|---|
protected |
KeyInfoImpl()
Creates a new instance of this
KeyInfoImpl. |
|
KeyInfoImpl(DOMCryptoContext context,
Node node)
Creates a new instance of this
KeyInfoImpl with the specified
context and node to unmarshal from. |
|
KeyInfoImpl(List content,
String id)
Creates a new instance of this
KeyInfoImpl with the specified
list of XMLStructures and Id-attribute value. |
protected |
KeyInfoImpl(Node node)
Creates a new instance of this
KeyInfoImpl with the specified
node. |
| Modifier and Type | Method and Description |
|---|---|
protected List |
getChildStructures()
Returns the list of child structures of this
DOMStructure. |
List |
getContent()
Returns an
unmodifiable list containing the key information. |
String |
getId()
Return the optional Id attribute of this
KeyInfo, which may be
useful for referencing this KeyInfo from other XML structures. |
String |
getLocalName()
Returns the local name of the represented XML element.
|
String |
getNamespace()
Returns the namespace URI of the represented XML element.
|
DOMStructure |
getParentStructure() |
void |
marshal(XMLStructure parent,
XMLCryptoContext context)
Marshals the key info to XML.
|
protected void |
marshalAttributes(DOMCryptoContext context,
Element parent)
Marshals an namespace-declaration for the XMLDSig name-space.
|
protected Attr |
marshalIDAttribute(DOMCryptoContext context,
Element parent)
Marshals the XML representation of an optional
Id-attribute
represented by this DOMStructure. |
protected void |
putChildStructure(DOMStructure childStructure)
Put an unmarshalled child structure.
|
void |
setLocalname(String localname)
Sets the localname of the marshaled node.
|
void |
setNamsepace(String namsepace)
Sets the namespace of the marshaled node.
|
protected void |
unmarshalAttributes(NamedNodeMap attributes,
DOMCryptoContext context)
Unmarshals the
Id-attribute. |
protected void |
unmarshalElement(DOMCryptoContext context,
Element element)
Unmarshals the given
element. |
protected void |
unmarshalStructures(NodeList nodes,
DOMCryptoContext context)
Unmarshals
DOMStructures from the given nodes. |
addBytesToElement, addBytesToElement, clearMarshalling, clearMarshalling, getBytesFromElement, getBytesFromElementStream, getChildStructureVersion, getHere, getImplClass, getInstance, getInstance, getNode, getParentStructureOf, getQualifiedName, getQualifiedName, hasNSDeclAttrInScope, isFeatureSupported, isNSDeclInScope, marshal, marshalElement, newIDforLookUp, putImplClass, setBackToCompatibilityPrior1_14, setNode, setParentStructure, toString, unmarshal, unmarshalIDAttribute, wrapNodeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisFeatureSupportedprotected List content_
null)protected String id_
Id-attribute value.protected String localname
protected String namsepace
protected KeyInfoImpl()
KeyInfoImpl.protected KeyInfoImpl(Node node) throws MarshalException
KeyInfoImpl with the specified
node.node - the nodeMarshalExceptionpublic KeyInfoImpl(DOMCryptoContext context, Node node) throws MarshalException
KeyInfoImpl with the specified
context and node to unmarshal from.context - the contextnode - the node to unmarshal fromMarshalException - if an exception occurs during unmarshalingpublic KeyInfoImpl(List content, String id)
KeyInfoImpl with the specified
list of XMLStructures and Id-attribute value.content - a list of XMLStructuresid - the Id-attribute valueNullPointerException - if config or content is nullIllegalArgumentException - if content is emptyClassCastException - if content contains any elements not of type
XMLStructurepublic String getLocalName()
DOMStructuregetLocalName in class DOMStructureDOMStructure.getLocalName()public void setLocalname(String localname)
localname - the localname of the marshaled node.public String getNamespace()
DOMStructuregetNamespace in class DOMStructureDOMStructure.getNamespace()public void setNamsepace(String namsepace)
namsepace - the namespace of the marshaled node.public List getContent()
javax.xml.crypto.dsig.keyinfo.KeyInfounmodifiable list containing the key information. Each entry of the list
is an XMLStructure.
If there is a public subclass representing the type of
XMLStructure, it is returned as an instance of that class (ex:
an X509Data element would be returned as an instance of
X509Data).
getContent in interface KeyInfoXMLStructure s in
this KeyInfo. Never returns null or an
empty list.KeyInfo.getContent()public String getId()
javax.xml.crypto.dsig.keyinfo.KeyInfoKeyInfo, which may be
useful for referencing this KeyInfo from other XML structures.getId in interface KeyInfoKeyInfo (may be
null if not specified)KeyInfo.getId()protected void marshalAttributes(DOMCryptoContext context, Element parent) throws MarshalException
marshalAttributes in class DOMStructurecontext - the marshal contextparent - the element is the parent of the attribute node created however, an
the attribute node is not a child of it's parent element. see XPath.MarshalException - if an exception occurs during marshalingprotected Attr marshalIDAttribute(DOMCryptoContext context, Element parent)
DOMStructureId-attribute
represented by this DOMStructure.
This method is called by DOMStructure.marshal(DOMCryptoContext, Node, Node).
A subclass has to overwrite this method in order to marshal an
Id-attribute.
marshalIDAttribute in class DOMStructurecontext - the marshal contextparent - the element is the parent of the attribute node created however, an
the attribute node is not a child of it's parent element. see XPath.Id-attribute if any, otherwise
nullDOMStructure.marshalIDAttribute(DOMCryptoContext,
Element)protected void unmarshalAttributes(NamedNodeMap attributes, DOMCryptoContext context) throws MarshalException
Id-attribute.unmarshalAttributes in class DOMStructureattributes - the Attributes to unmarshalcontext - the marshal contextMarshalException - if an exception occurs during unmarshalingprotected void putChildStructure(DOMStructure childStructure) throws MarshalException
DOMStructure
This method is called by
DOMStructure.unmarshalStructures(NodeList, DOMCryptoContext) for every
unmarshalled child structure.
A subclass has to overwrite this method to store the given child structure in its the corresponding field.
putChildStructure in class DOMStructurechildStructure - the unmarshalled child structureMarshalExceptionDOMStructure.putChildStructure(iaik.xml.crypto.dom.DOMStructure)protected List getChildStructures()
DOMStructureDOMStructure.
This method is called by DOMStructure.marshal(DOMCryptoContext, Node, Node).
A subclass has to overwrite this method to return a list of
DOMStrucutres represented by this subclass.
getChildStructures in class DOMStructureDOMStructures (may be empty, but never
null)DOMStructure.getChildStructures()protected void unmarshalStructures(NodeList nodes, DOMCryptoContext context) throws MarshalException
DOMStructureDOMStructures from the given nodes.
This method is called by DOMStructure.unmarshal(DOMCryptoContext).
This method calls DOMStructure.getInstance(Node, DOMCryptoContext) for every
Element in the list of nodes. If
DOMStructure.getInstance(Node, DOMCryptoContext) returns a
DOMStructure DOMStructure.putChildStructure(DOMStructure) is
called with the returned DOMStructure as parameter.
unmarshalStructures in class DOMStructurenodes - the nodes to unmarshal fromcontext - the marshal contextMarshalException - if an exception occurs during marshalingDOMStructure.unmarshalStructures(org.w3c.dom.NodeList,
DOMCryptoContext)protected void unmarshalElement(DOMCryptoContext context, Element element) throws MarshalException
DOMStructureelement.
This method is called by DOMStructure.unmarshal(DOMCryptoContext).
A subclass has to overwrite this method to perform any special unmarshaling required.
unmarshalElement in class DOMStructurecontext - the marshal contextelement - the element to be unmarshalMarshalException - if an exception occurs during unmarshalingDOMStructure.unmarshalElement(DOMCryptoContext,
org.w3c.dom.Element)public void marshal(XMLStructure parent, XMLCryptoContext context) throws MarshalException
javax.xml.crypto.dsig.keyinfo.KeyInfomarshal in interface KeyInfoparent - a mechanism-specific structure containing the parent node that the
marshalled key info will be appended tocontext - the XMLCryptoContext containing additional context (may
be null if not applicable)MarshalException - if the key info cannot be marshalledKeyInfo.marshal(javax.xml.crypto.XMLStructure,
javax.xml.crypto.XMLCryptoContext)public DOMStructure getParentStructure()
getParentStructure in class DOMStructureDOMStructure.DOMStructure.getParentStructure()© 2002-2005 IAIK, © 2004, 2006 - 2019 Stiftung SIC