KeyValuepublic class KeyValue extends SignatureElementProxy implements KeyInfoContentThe KeyValue element contains a single public key that may be useful in
validating the signature. Structured formats for defining DSA (REQUIRED)
and RSA (RECOMMENDED) public keys are defined in Signature Algorithms
(section 6.4). The KeyValue element may include externally defined public
keys values represented as PCDATA or element types from an external namespace. |
Fields Summary |
---|
static Logger | log{@link java.util.logging} logging facility |
Constructors Summary |
---|
public KeyValue(Document doc, DSAKeyValue dsaKeyValue)Constructor KeyValue
super(doc);
XMLUtils.addReturnToElement(this._constructionElement);
this._constructionElement.appendChild(dsaKeyValue.getElement());
XMLUtils.addReturnToElement(this._constructionElement);
| public KeyValue(Document doc, RSAKeyValue rsaKeyValue)Constructor KeyValue
super(doc);
XMLUtils.addReturnToElement(this._constructionElement);
this._constructionElement.appendChild(rsaKeyValue.getElement());
XMLUtils.addReturnToElement(this._constructionElement);
| public KeyValue(Document doc, Element unknownKeyValue)Constructor KeyValue
super(doc);
XMLUtils.addReturnToElement(this._constructionElement);
this._constructionElement.appendChild(unknownKeyValue);
XMLUtils.addReturnToElement(this._constructionElement);
| public KeyValue(Document doc, PublicKey pk)Constructor KeyValue
super(doc);
XMLUtils.addReturnToElement(this._constructionElement);
if (pk instanceof java.security.interfaces.DSAPublicKey) {
DSAKeyValue dsa = new DSAKeyValue(this._doc, pk);
this._constructionElement.appendChild(dsa.getElement());
XMLUtils.addReturnToElement(this._constructionElement);
} else if (pk instanceof java.security.interfaces.RSAPublicKey) {
RSAKeyValue rsa = new RSAKeyValue(this._doc, pk);
this._constructionElement.appendChild(rsa.getElement());
XMLUtils.addReturnToElement(this._constructionElement);
}
| public KeyValue(Element element, String BaseURI)Constructor KeyValue
super(element, BaseURI);
|
Methods Summary |
---|
public java.lang.String | getBaseLocalName()
return Constants._TAG_KEYVALUE;
| public java.security.PublicKey | getPublicKey()Method getPublicKey
Element rsa = XMLUtils.selectDsNode(this._constructionElement.getFirstChild(),
Constants._TAG_RSAKEYVALUE,0);
if (rsa != null) {
RSAKeyValue kv = new RSAKeyValue(rsa,
this._baseURI);
return kv.getPublicKey();
}
Element dsa = XMLUtils.selectDsNode(this._constructionElement,
Constants._TAG_DSAKEYVALUE,0);
if (dsa != null) {
DSAKeyValue kv = new DSAKeyValue(dsa,
this._baseURI);
return kv.getPublicKey();
}
return null;
|
|