1 | package com.yubico.fido.metadata; | |
2 | ||
3 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | |
4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; | |
5 | import com.yubico.internal.util.CollectionUtil; | |
6 | import com.yubico.webauthn.extension.uvm.KeyProtectionType; | |
7 | import com.yubico.webauthn.extension.uvm.MatcherProtectionType; | |
8 | import java.security.cert.X509Certificate; | |
9 | import java.util.List; | |
10 | import java.util.Optional; | |
11 | import java.util.Set; | |
12 | import lombok.Builder; | |
13 | import lombok.NonNull; | |
14 | import lombok.Value; | |
15 | import lombok.extern.jackson.Jacksonized; | |
16 | ||
17 | /** | |
18 | * Relying Parties can learn a subset of verifiable information for authenticators certified by the | |
19 | * FIDO Alliance with an Authenticator Metadata statement. The Metadata statement can be acquired | |
20 | * from the Metadata BLOB that is hosted on the Metadata Service [<a | |
21 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#biblio-fidometadataservice">FIDOMetadataService</a>]. | |
22 | * | |
23 | * <p>This class does not include the field <code>ecdaaTrustAnchors</code> since ECDAA is deprecated | |
24 | * in WebAuthn Level 2. | |
25 | * | |
26 | * @see <a | |
27 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
28 | * Metadata Statement</a> | |
29 | */ | |
30 | @Value | |
31 | @Builder(toBuilder = true) | |
32 | @Jacksonized | |
33 | public class MetadataStatement { | |
34 | ||
35 | /** | |
36 | * @see <a | |
37 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
38 | * Metadata Statement</a> | |
39 | */ | |
40 | String legalHeader; | |
41 | ||
42 | /** | |
43 | * @see <a | |
44 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
45 | * Metadata Statement</a> | |
46 | */ | |
47 | AAID aaid; | |
48 | ||
49 | /** | |
50 | * @see <a | |
51 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
52 | * Metadata Statement</a> | |
53 | */ | |
54 | AAGUID aaguid; | |
55 | ||
56 | /** | |
57 | * @see <a | |
58 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
59 | * Metadata Statement</a> | |
60 | */ | |
61 | Set<String> attestationCertificateKeyIdentifiers; | |
62 | ||
63 | /** | |
64 | * @see <a | |
65 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
66 | * Metadata Statement</a> | |
67 | */ | |
68 | String description; | |
69 | ||
70 | /** | |
71 | * @see <a | |
72 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
73 | * Metadata Statement</a> | |
74 | */ | |
75 | AlternativeDescriptions alternativeDescriptions; | |
76 | ||
77 | /** | |
78 | * @see <a | |
79 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
80 | * Metadata Statement</a> | |
81 | */ | |
82 | long authenticatorVersion; | |
83 | ||
84 | /** | |
85 | * @see <a | |
86 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
87 | * Metadata Statement</a> | |
88 | */ | |
89 | @NonNull ProtocolFamily protocolFamily; | |
90 | ||
91 | /** | |
92 | * @see <a | |
93 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
94 | * Metadata Statement</a> | |
95 | */ | |
96 | int schema; | |
97 | ||
98 | /** | |
99 | * @see <a | |
100 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
101 | * Metadata Statement</a> | |
102 | */ | |
103 | @NonNull Set<Version> upv; | |
104 | ||
105 | /** | |
106 | * @see <a | |
107 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
108 | * Metadata Statement</a> | |
109 | */ | |
110 | @NonNull Set<AuthenticationAlgorithm> authenticationAlgorithms; | |
111 | ||
112 | /** | |
113 | * @see <a | |
114 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
115 | * Metadata Statement</a> | |
116 | */ | |
117 | @NonNull Set<PublicKeyRepresentationFormat> publicKeyAlgAndEncodings; | |
118 | ||
119 | /** | |
120 | * @see <a | |
121 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
122 | * Metadata Statement</a> | |
123 | */ | |
124 | @NonNull Set<AuthenticatorAttestationType> attestationTypes; | |
125 | ||
126 | /** | |
127 | * @see <a | |
128 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
129 | * Metadata Statement</a> | |
130 | */ | |
131 | @NonNull Set<Set<VerificationMethodDescriptor>> userVerificationDetails; | |
132 | ||
133 | /** | |
134 | * @see <a | |
135 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
136 | * Metadata Statement</a> | |
137 | */ | |
138 | @NonNull Set<KeyProtectionType> keyProtection; | |
139 | ||
140 | /** | |
141 | * @see <a | |
142 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
143 | * Metadata Statement</a> | |
144 | */ | |
145 | Boolean isKeyRestricted; | |
146 | ||
147 | /** | |
148 | * @see <a | |
149 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
150 | * Metadata Statement</a> | |
151 | */ | |
152 | Boolean isFreshUserVerificationRequired; | |
153 | ||
154 | /** | |
155 | * @see <a | |
156 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
157 | * Metadata Statement</a> | |
158 | */ | |
159 | @NonNull Set<MatcherProtectionType> matcherProtection; | |
160 | ||
161 | /** | |
162 | * @see <a | |
163 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
164 | * Metadata Statement</a> | |
165 | */ | |
166 | Integer cryptoStrength; | |
167 | ||
168 | /** | |
169 | * @see <a | |
170 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
171 | * Metadata Statement</a> | |
172 | */ | |
173 | Set<AttachmentHint> attachmentHint; | |
174 | ||
175 | /** | |
176 | * @see <a | |
177 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
178 | * Metadata Statement</a> | |
179 | */ | |
180 | @NonNull Set<TransactionConfirmationDisplayType> tcDisplay; | |
181 | ||
182 | /** | |
183 | * @see <a | |
184 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
185 | * Metadata Statement</a> | |
186 | */ | |
187 | String tcDisplayContentType; | |
188 | ||
189 | /** | |
190 | * @see <a | |
191 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
192 | * Metadata Statement</a> | |
193 | */ | |
194 | List<DisplayPNGCharacteristicsDescriptor> tcDisplayPNGCharacteristics; | |
195 | ||
196 | /** | |
197 | * @see <a | |
198 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
199 | * Metadata Statement</a> | |
200 | */ | |
201 | @NonNull | |
202 | @JsonDeserialize(contentConverter = CertFromBase64Converter.class) | |
203 | @JsonSerialize(contentConverter = CertToBase64Converter.class) | |
204 | Set<X509Certificate> attestationRootCertificates; | |
205 | ||
206 | /** | |
207 | * @see <a | |
208 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
209 | * Metadata Statement</a> | |
210 | */ | |
211 | String icon; | |
212 | ||
213 | /** | |
214 | * @see <a | |
215 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
216 | * Metadata Statement</a> | |
217 | */ | |
218 | Set<ExtensionDescriptor> supportedExtensions; | |
219 | ||
220 | /** | |
221 | * @see <a | |
222 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
223 | * Metadata Statement</a> | |
224 | */ | |
225 | AuthenticatorGetInfo authenticatorGetInfo; | |
226 | ||
227 | public MetadataStatement( | |
228 | String legalHeader, | |
229 | AAID aaid, | |
230 | AAGUID aaguid, | |
231 | Set<String> attestationCertificateKeyIdentifiers, | |
232 | String description, | |
233 | AlternativeDescriptions alternativeDescriptions, | |
234 | long authenticatorVersion, | |
235 |
1
1. <init> : negated conditional → KILLED |
@NonNull ProtocolFamily protocolFamily, |
236 | int schema, | |
237 |
1
1. <init> : negated conditional → KILLED |
@NonNull Set<Version> upv, |
238 |
1
1. <init> : negated conditional → KILLED |
@NonNull Set<AuthenticationAlgorithm> authenticationAlgorithms, |
239 |
1
1. <init> : negated conditional → KILLED |
@NonNull Set<PublicKeyRepresentationFormat> publicKeyAlgAndEncodings, |
240 |
1
1. <init> : negated conditional → KILLED |
@NonNull Set<AuthenticatorAttestationType> attestationTypes, |
241 |
1
1. <init> : negated conditional → KILLED |
@NonNull Set<Set<VerificationMethodDescriptor>> userVerificationDetails, |
242 |
1
1. <init> : negated conditional → KILLED |
@NonNull Set<KeyProtectionType> keyProtection, |
243 | Boolean isKeyRestricted, | |
244 | Boolean isFreshUserVerificationRequired, | |
245 |
1
1. <init> : negated conditional → KILLED |
@NonNull Set<MatcherProtectionType> matcherProtection, |
246 | Integer cryptoStrength, | |
247 | Set<AttachmentHint> attachmentHint, | |
248 |
1
1. <init> : negated conditional → KILLED |
@NonNull Set<TransactionConfirmationDisplayType> tcDisplay, |
249 | String tcDisplayContentType, | |
250 | List<DisplayPNGCharacteristicsDescriptor> tcDisplayPNGCharacteristics, | |
251 |
1
1. <init> : negated conditional → KILLED |
@NonNull Set<X509Certificate> attestationRootCertificates, |
252 | String icon, | |
253 | Set<ExtensionDescriptor> supportedExtensions, | |
254 | AuthenticatorGetInfo authenticatorGetInfo) { | |
255 | this.legalHeader = legalHeader; | |
256 | this.aaid = aaid; | |
257 | this.aaguid = aaguid; | |
258 | this.attestationCertificateKeyIdentifiers = | |
259 | CollectionUtil.immutableSetOrEmpty(attestationCertificateKeyIdentifiers); | |
260 | this.description = description; | |
261 | this.alternativeDescriptions = alternativeDescriptions; | |
262 | this.authenticatorVersion = authenticatorVersion; | |
263 | this.protocolFamily = protocolFamily; | |
264 | this.schema = schema; | |
265 | this.upv = upv; | |
266 | this.authenticationAlgorithms = authenticationAlgorithms; | |
267 | this.publicKeyAlgAndEncodings = publicKeyAlgAndEncodings; | |
268 | this.attestationTypes = attestationTypes; | |
269 | this.userVerificationDetails = userVerificationDetails; | |
270 | this.keyProtection = keyProtection; | |
271 | this.isKeyRestricted = isKeyRestricted; | |
272 | this.isFreshUserVerificationRequired = isFreshUserVerificationRequired; | |
273 | this.matcherProtection = matcherProtection; | |
274 | this.cryptoStrength = cryptoStrength; | |
275 | this.attachmentHint = attachmentHint; | |
276 | this.tcDisplay = tcDisplay; | |
277 | this.tcDisplayContentType = tcDisplayContentType; | |
278 | this.tcDisplayPNGCharacteristics = tcDisplayPNGCharacteristics; | |
279 | this.attestationRootCertificates = attestationRootCertificates; | |
280 | this.icon = icon; | |
281 | this.supportedExtensions = supportedExtensions; | |
282 | this.authenticatorGetInfo = authenticatorGetInfo; | |
283 | } | |
284 | ||
285 | /** | |
286 | * @see <a | |
287 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
288 | * Metadata Statement</a> | |
289 | */ | |
290 | public Optional<String> getLegalHeader() { | |
291 |
1
1. getLegalHeader : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getLegalHeader → SURVIVED |
return Optional.ofNullable(this.legalHeader); |
292 | } | |
293 | ||
294 | /** | |
295 | * @see <a | |
296 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
297 | * Metadata Statement</a> | |
298 | */ | |
299 | public Optional<AAID> getAaid() { | |
300 |
1
1. getAaid : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getAaid → SURVIVED |
return Optional.ofNullable(this.aaid); |
301 | } | |
302 | ||
303 | /** | |
304 | * @see <a | |
305 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
306 | * Metadata Statement</a> | |
307 | */ | |
308 | public Optional<AAGUID> getAaguid() { | |
309 |
1
1. getAaguid : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getAaguid → SURVIVED |
return Optional.ofNullable(this.aaguid); |
310 | } | |
311 | ||
312 | /** | |
313 | * @see <a | |
314 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
315 | * Metadata Statement</a> | |
316 | */ | |
317 | public Optional<String> getDescription() { | |
318 |
1
1. getDescription : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getDescription → SURVIVED |
return Optional.ofNullable(this.description); |
319 | } | |
320 | ||
321 | /** | |
322 | * @see <a | |
323 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
324 | * Metadata Statement</a> | |
325 | */ | |
326 | public Optional<AlternativeDescriptions> getAlternativeDescriptions() { | |
327 |
1
1. getAlternativeDescriptions : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getAlternativeDescriptions → SURVIVED |
return Optional.ofNullable(this.alternativeDescriptions); |
328 | } | |
329 | ||
330 | /** | |
331 | * @see <a | |
332 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
333 | * Metadata Statement</a> | |
334 | */ | |
335 | public Optional<Boolean> getIsKeyRestricted() { | |
336 |
1
1. getIsKeyRestricted : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getIsKeyRestricted → SURVIVED |
return Optional.ofNullable(this.isKeyRestricted); |
337 | } | |
338 | ||
339 | /** | |
340 | * @see <a | |
341 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
342 | * Metadata Statement</a> | |
343 | */ | |
344 | public Optional<Boolean> getIsFreshUserVerificationRequired() { | |
345 |
1
1. getIsFreshUserVerificationRequired : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getIsFreshUserVerificationRequired → SURVIVED |
return Optional.ofNullable(this.isFreshUserVerificationRequired); |
346 | } | |
347 | ||
348 | /** | |
349 | * @see <a | |
350 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
351 | * Metadata Statement</a> | |
352 | */ | |
353 | public Optional<Integer> getCryptoStrength() { | |
354 |
1
1. getCryptoStrength : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getCryptoStrength → SURVIVED |
return Optional.ofNullable(this.cryptoStrength); |
355 | } | |
356 | ||
357 | /** | |
358 | * @see <a | |
359 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
360 | * Metadata Statement</a> | |
361 | */ | |
362 | public Optional<Set<AttachmentHint>> getAttachmentHint() { | |
363 |
1
1. getAttachmentHint : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getAttachmentHint → SURVIVED |
return Optional.ofNullable(this.attachmentHint); |
364 | } | |
365 | ||
366 | /** | |
367 | * @see <a | |
368 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
369 | * Metadata Statement</a> | |
370 | */ | |
371 | public Optional<String> getTcDisplayContentType() { | |
372 |
1
1. getTcDisplayContentType : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getTcDisplayContentType → SURVIVED |
return Optional.ofNullable(this.tcDisplayContentType); |
373 | } | |
374 | ||
375 | /** | |
376 | * @see <a | |
377 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
378 | * Metadata Statement</a> | |
379 | */ | |
380 | public Optional<List<DisplayPNGCharacteristicsDescriptor>> getTcDisplayPNGCharacteristics() { | |
381 |
1
1. getTcDisplayPNGCharacteristics : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getTcDisplayPNGCharacteristics → SURVIVED |
return Optional.ofNullable(this.tcDisplayPNGCharacteristics); |
382 | } | |
383 | ||
384 | /** | |
385 | * @see <a | |
386 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
387 | * Metadata Statement</a> | |
388 | */ | |
389 | public Optional<String> getIcon() { | |
390 |
1
1. getIcon : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getIcon → SURVIVED |
return Optional.ofNullable(this.icon); |
391 | } | |
392 | ||
393 | /** | |
394 | * @see <a | |
395 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
396 | * Metadata Statement</a> | |
397 | */ | |
398 | public Optional<Set<ExtensionDescriptor>> getSupportedExtensions() { | |
399 |
1
1. getSupportedExtensions : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getSupportedExtensions → SURVIVED |
return Optional.ofNullable(this.supportedExtensions); |
400 | } | |
401 | ||
402 | /** | |
403 | * @see <a | |
404 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#metadata-statement-format">FIDO | |
405 | * Metadata Statement</a> | |
406 | */ | |
407 | public Optional<AuthenticatorGetInfo> getAuthenticatorGetInfo() { | |
408 |
1
1. getAuthenticatorGetInfo : replaced return value with Optional.empty for com/yubico/fido/metadata/MetadataStatement::getAuthenticatorGetInfo → SURVIVED |
return Optional.ofNullable(this.authenticatorGetInfo); |
409 | } | |
410 | } | |
Mutations | ||
235 |
1.1 |
|
237 |
1.1 |
|
238 |
1.1 |
|
239 |
1.1 |
|
240 |
1.1 |
|
241 |
1.1 |
|
242 |
1.1 |
|
245 |
1.1 |
|
248 |
1.1 |
|
251 |
1.1 |
|
291 |
1.1 |
|
300 |
1.1 |
|
309 |
1.1 |
|
318 |
1.1 |
|
327 |
1.1 |
|
336 |
1.1 |
|
345 |
1.1 |
|
354 |
1.1 |
|
363 |
1.1 |
|
372 |
1.1 |
|
381 |
1.1 |
|
390 |
1.1 |
|
399 |
1.1 |
|
408 |
1.1 |