1
1
package io .calidog .certstream ;
2
2
3
- import sun .reflect .generics .reflectiveObjects .NotImplementedException ;
4
-
5
3
import javax .security .auth .x500 .X500Principal ;
6
4
import java .math .BigInteger ;
7
5
import java .security .*;
8
- import java .security .cert .Certificate ;
9
6
import java .security .cert .*;
10
7
import java .time .Instant ;
11
8
import java .util .*;
16
13
*/
17
14
public class CertStreamCertificate extends X509Certificate {
18
15
private HashMap <String , String > subject ;
19
- private HashMap <String , String > extensions ;
16
+ private HashMap <String , String [] > extensions ;
20
17
21
18
private double notBefore ;
22
19
private double notAfter ;
@@ -77,25 +74,25 @@ public void checkValidity(Date date) throws CertificateExpiredException, Certifi
77
74
/**Not implemented*/
78
75
@ Override
79
76
public int getVersion () {
80
- throw new NotImplementedException ();
77
+ throw new UnsupportedOperationException ();
81
78
}
82
79
83
80
/**Not implemented*/
84
81
@ Override
85
82
public BigInteger getSerialNumber () {
86
- throw new NotImplementedException ();
83
+ throw new UnsupportedOperationException ();
87
84
}
88
85
89
86
/**Not implemented*/
90
87
@ Override
91
88
public Principal getIssuerDN () {
92
- throw new NotImplementedException ();
89
+ throw new UnsupportedOperationException ();
93
90
}
94
91
95
92
/**Not implemented*/
96
93
@ Override
97
94
public X500Principal getIssuerX500Principal () {
98
- throw new NotImplementedException ();
95
+ throw new UnsupportedOperationException ();
99
96
}
100
97
101
98
/**Not implemented*/
@@ -122,66 +119,66 @@ public Date getNotAfter() {
122
119
/**Not implemented*/
123
120
@ Override
124
121
public byte [] getTBSCertificate () throws CertificateEncodingException {
125
- throw new NotImplementedException ();
122
+ throw new UnsupportedOperationException ();
126
123
}
127
124
/**Not implemented*/
128
125
@ Override
129
126
public byte [] getSignature () {
130
- throw new NotImplementedException ();
127
+ throw new UnsupportedOperationException ();
131
128
}
132
129
133
130
/**Not implemented*/
134
131
@ Override
135
132
public String getSigAlgName () {
136
- throw new NotImplementedException ();
133
+ throw new UnsupportedOperationException ();
137
134
}
138
135
139
136
/**Not implemented*/
140
137
@ Override
141
138
public String getSigAlgOID () {
142
- throw new NotImplementedException ();
139
+ throw new UnsupportedOperationException ();
143
140
}
144
141
145
142
/**Not implemented*/
146
143
@ Override
147
144
public byte [] getSigAlgParams () {
148
- throw new NotImplementedException ();
145
+ throw new UnsupportedOperationException ();
149
146
}
150
147
151
148
/**Not implemented*/
152
149
@ Override
153
150
public boolean [] getIssuerUniqueID () {
154
- throw new NotImplementedException ();
151
+ throw new UnsupportedOperationException ();
155
152
}
156
153
157
154
/**Not implemented*/
158
155
@ Override
159
156
public boolean [] getSubjectUniqueID () {
160
- throw new NotImplementedException ();
157
+ throw new UnsupportedOperationException ();
161
158
}
162
159
163
160
/**Not implemented*/
164
161
@ Override
165
162
public boolean [] getKeyUsage () {
166
- throw new NotImplementedException ();
163
+ throw new UnsupportedOperationException ();
167
164
}
168
165
169
166
/**Not implemented*/
170
167
@ Override
171
168
public List <String > getExtendedKeyUsage () throws CertificateParsingException {
172
- throw new NotImplementedException ();
169
+ throw new UnsupportedOperationException ();
173
170
}
174
171
175
172
/**Not implemented*/
176
173
@ Override
177
174
public int getBasicConstraints () {
178
- throw new NotImplementedException ();
175
+ throw new UnsupportedOperationException ();
179
176
}
180
177
181
178
/**Not implemented*/
182
179
@ Override
183
180
public Collection <List <?>> getSubjectAlternativeNames () throws CertificateParsingException {
184
- throw new NotImplementedException ();
181
+ throw new UnsupportedOperationException ();
185
182
}
186
183
187
184
@ Override
@@ -206,49 +203,49 @@ public byte[] getEncoded() throws CertificateEncodingException {
206
203
/**Not implemented*/
207
204
@ Override
208
205
public void verify (PublicKey publicKey ) throws CertificateException , NoSuchAlgorithmException , InvalidKeyException , NoSuchProviderException , SignatureException {
209
- throw new NotImplementedException ();
206
+ throw new UnsupportedOperationException ();
210
207
}
211
208
212
209
/**Not implemented*/
213
210
@ Override
214
211
public void verify (PublicKey publicKey , String s ) throws CertificateException , NoSuchAlgorithmException , InvalidKeyException , NoSuchProviderException , SignatureException {
215
- throw new NotImplementedException ();
212
+ throw new UnsupportedOperationException ();
216
213
}
217
214
218
215
/**Not implemented*/
219
216
@ Override
220
217
public String toString () {
221
- throw new NotImplementedException ();
218
+ throw new UnsupportedOperationException ();
222
219
}
223
220
224
221
/**Not implemented*/
225
222
@ Override
226
223
public PublicKey getPublicKey () {
227
- throw new NotImplementedException ();
224
+ throw new UnsupportedOperationException ();
228
225
}
229
226
230
227
/**Not implemented*/
231
228
@ Override
232
229
public boolean hasUnsupportedCriticalExtension () {
233
- throw new NotImplementedException ();
230
+ throw new UnsupportedOperationException ();
234
231
}
235
232
236
233
/**Not implemented*/
237
234
@ Override
238
235
public Set <String > getCriticalExtensionOIDs () {
239
- throw new NotImplementedException ();
236
+ throw new UnsupportedOperationException ();
240
237
}
241
238
242
239
/**Not implemented*/
243
240
@ Override
244
241
public Set <String > getNonCriticalExtensionOIDs () {
245
- throw new NotImplementedException ();
242
+ throw new UnsupportedOperationException ();
246
243
}
247
244
248
245
/**Not implemented*/
249
246
@ Override
250
247
public byte [] getExtensionValue (String s ) {
251
- throw new NotImplementedException ();
248
+ throw new UnsupportedOperationException ();
252
249
}
253
250
254
251
/**
@@ -257,7 +254,7 @@ public byte[] getExtensionValue(String s) {
257
254
* passed-in oid String. The oid string is represented
258
255
* by whatever CertStream passes us.
259
256
*/
260
- public String getStringExtensionValue (String key )
257
+ public String [] getStringExtensionValue (String key )
261
258
{
262
259
return extensions .get (key );
263
260
}
0 commit comments