1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.xml.encryption.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.encryption.CipherData;
25 import org.opensaml.xml.encryption.EncryptedType;
26 import org.opensaml.xml.encryption.EncryptionMethod;
27 import org.opensaml.xml.encryption.EncryptionProperties;
28 import org.opensaml.xml.signature.KeyInfo;
29 import org.opensaml.xml.validation.AbstractValidatingXMLObject;
30
31
32
33
34 public abstract class EncryptedTypeImpl extends AbstractValidatingXMLObject implements EncryptedType {
35
36
37 private String id;
38
39
40 private String type;
41
42
43 private String mimeType;
44
45
46 private String encoding;
47
48
49 private EncryptionMethod encryptionMethod;
50
51
52 private KeyInfo keyInfo;
53
54
55 private CipherData cipherData;
56
57
58 private EncryptionProperties encryptionProperties;
59
60
61
62
63
64
65
66
67 protected EncryptedTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
68 super(namespaceURI, elementLocalName, namespacePrefix);
69 }
70
71
72 public String getID() {
73 return this.id;
74 }
75
76
77 public void setID(String newID) {
78 String oldID = this.id;
79 this.id = prepareForAssignment(this.id, newID);
80 registerOwnID(oldID, this.id);
81 }
82
83
84 public String getType() {
85 return this.type;
86 }
87
88
89 public void setType(String newType) {
90 this.type = prepareForAssignment(this.type, newType);
91 }
92
93
94 public String getMimeType() {
95 return this.mimeType;
96 }
97
98
99 public void setMimeType(String newMimeType) {
100 this.mimeType = prepareForAssignment(this.mimeType, newMimeType);
101 }
102
103
104 public String getEncoding() {
105 return this.encoding;
106 }
107
108
109 public void setEncoding(String newEncoding) {
110 this.encoding = prepareForAssignment(this.encoding, newEncoding);
111 }
112
113
114 public EncryptionMethod getEncryptionMethod() {
115 return this.encryptionMethod;
116 }
117
118
119 public void setEncryptionMethod(EncryptionMethod newEncryptionMethod) {
120 this.encryptionMethod = prepareForAssignment(this.encryptionMethod, newEncryptionMethod);
121 }
122
123
124 public KeyInfo getKeyInfo() {
125 return this.keyInfo;
126 }
127
128
129 public void setKeyInfo(KeyInfo newKeyInfo) {
130 this.keyInfo = prepareForAssignment(this.keyInfo, newKeyInfo);
131 }
132
133
134 public CipherData getCipherData() {
135 return this.cipherData;
136 }
137
138
139 public void setCipherData(CipherData newCipherData) {
140 this.cipherData = prepareForAssignment(this.cipherData, newCipherData);
141 }
142
143
144 public EncryptionProperties getEncryptionProperties() {
145 return this.encryptionProperties;
146 }
147
148
149 public void setEncryptionProperties(EncryptionProperties newEncryptionProperties) {
150 this.encryptionProperties = prepareForAssignment(this.encryptionProperties, newEncryptionProperties);
151 }
152
153
154 public List<XMLObject> getOrderedChildren() {
155 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
156
157 if (encryptionMethod != null) {
158 children.add(encryptionMethod);
159 }
160 if (keyInfo != null) {
161 children.add(keyInfo);
162 }
163 if (cipherData != null) {
164 children.add(cipherData);
165 }
166 if (encryptionProperties!= null) {
167 children.add(encryptionProperties);
168 }
169
170 if (children.size() == 0) {
171 return null;
172 }
173
174 return Collections.unmodifiableList(children);
175 }
176
177 }