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 java.util.ArrayList;
20 import java.util.Collections;
21 import java.util.List;
22
23 import org.opensaml.xml.XMLObject;
24 import org.opensaml.xml.signature.DSAKeyValue;
25 import org.opensaml.xml.signature.KeyValue;
26 import org.opensaml.xml.signature.RSAKeyValue;
27 import org.opensaml.xml.validation.AbstractValidatingXMLObject;
28
29
30
31
32 public class KeyValueImpl extends AbstractValidatingXMLObject implements KeyValue {
33
34
35 private DSAKeyValue dsaKeyValue;
36
37
38 private RSAKeyValue rsaKeyValue;
39
40
41 private XMLObject unknownXMLObject;
42
43
44
45
46
47
48
49
50 protected KeyValueImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
51 super(namespaceURI, elementLocalName, namespacePrefix);
52 }
53
54
55 public DSAKeyValue getDSAKeyValue() {
56 return this.dsaKeyValue;
57 }
58
59
60 public void setDSAKeyValue(DSAKeyValue newDSAKeyValue) {
61 this.dsaKeyValue = prepareForAssignment(this.dsaKeyValue, newDSAKeyValue);
62 }
63
64
65 public RSAKeyValue getRSAKeyValue() {
66 return this.rsaKeyValue;
67 }
68
69
70 public void setRSAKeyValue(RSAKeyValue newRSAKeyValue) {
71 this.rsaKeyValue = prepareForAssignment(this.rsaKeyValue, newRSAKeyValue);
72 }
73
74
75 public XMLObject getUnknownXMLObject() {
76 return this.unknownXMLObject;
77 }
78
79
80 public void setUnknownXMLObject(XMLObject newXMLObject) {
81 this.unknownXMLObject = prepareForAssignment(this.unknownXMLObject, newXMLObject);
82 }
83
84
85 public List<XMLObject> getOrderedChildren() {
86 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
87
88 if (dsaKeyValue != null) {
89 children.add(dsaKeyValue);
90 }
91 if (rsaKeyValue != null) {
92 children.add(rsaKeyValue);
93 }
94 if (unknownXMLObject != null) {
95 children.add(unknownXMLObject);
96 }
97
98 if (children.size() == 0) {
99 return null;
100 }
101
102 return Collections.unmodifiableList(children);
103 }
104
105 }