public class KeyInfo extends BaseElement
KeyInfo is an optional element that enables the recipient(s) to obtain the key needed to validate the signature. KeyInfo may contain keys, names, certificates and other public key management information, such as in-band key distribution or key agreement data. This specification defines a few simple types but applications may extend those types or all together replace them with their own key identification and exchange semantics using the XML namespace facility. [XML-ns] However, questions of trust of such key information (e.g., its authenticity or strength) are out of scope of this specification and left to the application.
If KeyInfo is omitted, the recipient is expected to be able to identify the key based on application context. Multiple declarations within KeyInfo refer to the same key. While applications may define and use any mechanism they choose through inclusion of elements from a different namespace, compliant versions MUST implement KeyValue (section 4.4.2) and SHOULD implement RetrievalMethod (section 4.4.3).
The schema/DTD specifications of many of KeyInfo's children (e.g., PGPData, SPKIData, X509Data) permit their content to be extended/complemented with elements from another namespace. This may be done only if it is safe to ignore these extension elements while claiming support for the types defined in this specification. Otherwise, external elements, including alternative structures to those defined by this specification, MUST be a child of KeyInfo. For example, should a complete XML-PGP standard be defined, its root element MUST be a child of KeyInfo. (Of course, new structures from external namespaces can incorporate elements from the &dsig; namespace via features of the type definition language. For instance, they can create a DTD that mixes their own and dsig qualified elements, or a schema that permits, includes, imports, or derives new types based on &dsig; elements.)
The following schema fragment specifies the expected content contained within this class.
<complexType name="KeyInfoType">
<complexContent>
<restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
<choice maxOccurs="unbounded">
<element ref="{http://www.w3.org/2000/09/xmldsig#}KeyName"/>
<element ref="{http://www.w3.org/2000/09/xmldsig#}KeyValue"/>
<element ref="{http://www.w3.org/2000/09/xmldsig#}RetrievalMethod"/>
<element ref="{http://www.w3.org/2000/09/xmldsig#}X509Data"/>
<element ref="{http://www.w3.org/2000/09/xmldsig#}PGPData"/>
<element ref="{http://www.w3.org/2000/09/xmldsig#}SPKIData"/>
<element ref="{http://www.w3.org/2000/09/xmldsig#}MgmtData"/>
<any processContents='lax' namespace='##other'/>
</choice>
<attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
</restriction>
</complexContent>
</complexType>
mContext, mElement, mId| Constructor and Description |
|---|
KeyInfo(Context aBaglam) |
KeyInfo(org.w3c.dom.Element aElement,
Context aContext)
Construct KeyInfo from existing
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(KeyInfoElement aElement) |
KeyInfoElement |
get(int aIndex) |
int |
getElementCount() |
java.lang.String |
getLocalName() |
static KeyInfoElement |
resolve(org.w3c.dom.Element aElement,
Context aBaglam) |
tr.gov.tubitak.uekae.esya.api.asn.x509.ECertificate |
resolveCertificate() |
java.security.PublicKey |
resolvePublicKey() |
addBigIntegerElement, addLineBreak, addLineBreak, checkNamespace, createElement, generateAndSetId, getAttribute, getBigIntegerFromElement, getChildText, getContext, getDocument, getElement, getId, getNamespace, insertBase64EncodedElement, insertElement, insertTextElement, selectChildElement, selectChildren, setIdpublic KeyInfo(Context aBaglam)
public KeyInfo(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 static KeyInfoElement resolve(org.w3c.dom.Element aElement, Context aBaglam) throws XMLSignatureException
XMLSignatureExceptionpublic int getElementCount()
throws XMLSignatureException
XMLSignatureExceptionpublic KeyInfoElement get(int aIndex) throws XMLSignatureException
XMLSignatureExceptionpublic void add(KeyInfoElement aElement)
public tr.gov.tubitak.uekae.esya.api.asn.x509.ECertificate resolveCertificate()
throws XMLSignatureException
XMLSignatureExceptionpublic java.security.PublicKey resolvePublicKey()
throws XMLSignatureException
XMLSignatureExceptionpublic java.lang.String getLocalName()
getLocalName in class BaseElementCopyright © 2025. All rights reserved.