1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.xml.signature.impl;
18
19 import org.opensaml.xml.XMLObject;
20 import org.opensaml.xml.io.UnmarshallingException;
21 import org.opensaml.xml.signature.DSAKeyValue;
22 import org.opensaml.xml.signature.KeyValue;
23 import org.opensaml.xml.signature.RSAKeyValue;
24
25
26
27
28 public class KeyValueUnmarshaller extends AbstractXMLSignatureUnmarshaller {
29
30
31 protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
32 throws UnmarshallingException {
33 KeyValue keyValue = (KeyValue) parentXMLObject;
34
35 if (childXMLObject instanceof DSAKeyValue) {
36 keyValue.setDSAKeyValue((DSAKeyValue) childXMLObject);
37 } else if (childXMLObject instanceof RSAKeyValue) {
38 keyValue.setRSAKeyValue((RSAKeyValue) childXMLObject);
39 } else {
40
41 if (keyValue.getUnknownXMLObject() == null) {
42 keyValue.setUnknownXMLObject(childXMLObject);
43 } else {
44
45 super.processChildElement(parentXMLObject, childXMLObject);
46 }
47 }
48 }
49
50 }