AuthenticatorGetInfo.java

1
package com.yubico.fido.metadata;
2
3
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4
import com.fasterxml.jackson.core.JacksonException;
5
import com.fasterxml.jackson.core.JsonGenerator;
6
import com.fasterxml.jackson.core.JsonParser;
7
import com.fasterxml.jackson.databind.DeserializationContext;
8
import com.fasterxml.jackson.databind.JsonDeserializer;
9
import com.fasterxml.jackson.databind.JsonSerializer;
10
import com.fasterxml.jackson.databind.SerializerProvider;
11
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
12
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
13
import com.yubico.webauthn.data.AuthenticatorTransport;
14
import com.yubico.webauthn.data.PublicKeyCredentialParameters;
15
import com.yubico.webauthn.extension.uvm.UserVerificationMethod;
16
import java.io.IOException;
17
import java.util.Arrays;
18
import java.util.List;
19
import java.util.Map;
20
import java.util.Optional;
21
import java.util.Set;
22
import java.util.stream.Collectors;
23
import java.util.stream.Stream;
24
import lombok.Builder;
25
import lombok.NonNull;
26
import lombok.Value;
27
import lombok.extern.jackson.Jacksonized;
28
29
/**
30
 * This dictionary describes supported versions, extensions, AAGUID of the device and its
31
 * capabilities.
32
 *
33
 * <p>See: <a
34
 * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
35
 * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
36
 *
37
 * @see <a
38
 *     href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#authenticatorgetinfo-dictionary">FIDO
39
 *     Metadata Statement §3.12. AuthenticatorGetInfo dictionary</a>
40
 * @see <a
41
 *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
42
 *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
43
 */
44
@Value
45
@Builder(toBuilder = true)
46
@Jacksonized
47
@JsonIgnoreProperties({
48
  "maxAuthenticatorConfigLength", // Present in example but not defined
49
  "defaultCredProtect", // Present in example but not defined
50
  "encIdentifier", // Nonsensical in MDS context
51
  "encCredStoreState" // Nonsensical in MDS context
52
})
53
public class AuthenticatorGetInfo {
54
55
  /**
56
   * @see <a
57
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
58
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
59
   */
60
  @NonNull Set<CtapVersion> versions;
61
62
  /**
63
   * @see <a
64
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
65
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
66
   */
67
  Set<String> extensions;
68
69
  /**
70
   * @see <a
71
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
72
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
73
   */
74
  AAGUID aaguid;
75
76
  /**
77
   * @see <a
78
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
79
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
80
   */
81
  SupportedCtapOptions options;
82
83
  /**
84
   * @see <a
85
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
86
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
87
   */
88
  Integer maxMsgSize;
89
90
  /**
91
   * @see <a
92
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
93
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
94
   */
95
  Set<CtapPinUvAuthProtocolVersion> pinUvAuthProtocols;
96
97
  /**
98
   * @see <a
99
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
100
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
101
   */
102
  Integer maxCredentialCountInList;
103
104
  /**
105
   * @see <a
106
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
107
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
108
   */
109
  Integer maxCredentialIdLength;
110
111
  /**
112
   * @see <a
113
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
114
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
115
   */
116
  Set<AuthenticatorTransport> transports;
117
118
  /**
119
   * @see <a
120
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
121
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
122
   */
123
  @JsonDeserialize(using = ListPublicKeyCredentialParametersIgnoringUnknownValuesDeserializer.class)
124
  List<PublicKeyCredentialParameters> algorithms;
125
126
  /**
127
   * @see <a
128
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
129
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
130
   */
131
  Integer maxSerializedLargeBlobArray;
132
133
  /**
134
   * @see <a
135
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
136
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
137
   */
138
  Boolean forcePINChange;
139
140
  /**
141
   * @see <a
142
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
143
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
144
   */
145
  Integer minPINLength;
146
147
  /**
148
   * @see <a
149
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
150
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
151
   */
152
  Integer firmwareVersion;
153
154
  /**
155
   * @see <a
156
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
157
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
158
   */
159
  Integer maxCredBlobLength;
160
161
  /**
162
   * @see <a
163
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
164
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
165
   */
166
  Integer maxRPIDsForSetMinPINLength;
167
168
  /**
169
   * @see <a
170
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
171
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
172
   */
173
  Integer preferredPlatformUvAttempts;
174
175
  @JsonDeserialize(using = SetFromIntJsonDeserializer.class)
176
  @JsonSerialize(contentUsing = IntFromSetJsonSerializer.class)
177
  Set<UserVerificationMethod> uvModality;
178
179
  Map<CtapCertificationId, Integer> certifications;
180
  Integer remainingDiscoverableCredentials;
181
  Set<Integer> vendorPrototypeConfigCommands;
182
183
  /**
184
   * @since 2.9.0
185
   * @see <a
186
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
187
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
188
   */
189
  List<String> attestationFormats;
190
191
  /**
192
   * <code>true</code> if the <code>longTouchForReset</code> member is set to <code>true</code> or
193
   * <code>false</code> in the metadata statement. <code>false</code> if the <code>longTouchForReset
194
   * </code> member is absent in the metadata statement.
195
   *
196
   * @since 2.9.0
197
   * @see <a
198
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
199
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
200
   */
201
  boolean longTouchForReset;
202
203
  /**
204
   * @since 2.9.0
205
   * @see <a
206
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
207
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
208
   */
209
  Integer uvCountSinceLastPinEntry;
210
211
  /**
212
   * @since 2.9.0
213
   * @see <a
214
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
215
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
216
   */
217
  Set<String> transportsForReset;
218
219
  /**
220
   * <code>true</code> if the <code>pinComplexityPolicy</code> member is set to <code>true</code> or
221
   * <code>false</code> in the metadata statement. <code>false</code> if the <code>
222
   * pinComplexityPolicy</code> member is absent in the metadata statement.
223
   *
224
   * @since 2.9.0
225
   * @see <a
226
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
227
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
228
   */
229
  boolean pinComplexityPolicy;
230
231
  /**
232
   * @since 2.9.0
233
   * @see <a
234
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
235
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
236
   */
237
  String pinComplexityPolicyURL;
238
239
  /**
240
   * @since 2.9.0
241
   * @see <a
242
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
243
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
244
   */
245
  Integer maxPINLength;
246
247
  /**
248
   * @since 2.9.0
249
   * @see <a
250
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
251
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
252
   */
253
  Set<Integer> authenticatorConfigCommands;
254
255
  AuthenticatorGetInfo(
256 1 1. <init> : negated conditional → KILLED
      @NonNull Set<CtapVersion> versions,
257
      Set<String> extensions,
258
      AAGUID aaguid,
259
      SupportedCtapOptions options,
260
      Integer maxMsgSize,
261
      Set<CtapPinUvAuthProtocolVersion> pinUvAuthProtocols,
262
      Integer maxCredentialCountInList,
263
      Integer maxCredentialIdLength,
264
      Set<AuthenticatorTransport> transports,
265
      List<PublicKeyCredentialParameters> algorithms,
266
      Integer maxSerializedLargeBlobArray,
267
      Boolean forcePINChange,
268
      Integer minPINLength,
269
      Integer firmwareVersion,
270
      Integer maxCredBlobLength,
271
      Integer maxRPIDsForSetMinPINLength,
272
      Integer preferredPlatformUvAttempts,
273
      Set<UserVerificationMethod> uvModality,
274
      Map<CtapCertificationId, Integer> certifications,
275
      Integer remainingDiscoverableCredentials,
276
      Set<Integer> vendorPrototypeConfigCommands,
277
      List<String> attestationFormats,
278
      Boolean longTouchForReset,
279
      Integer uvCountSinceLastPinEntry,
280
      Set<String> transportsForReset,
281
      Boolean pinComplexityPolicy,
282
      String pinComplexityPolicyURL,
283
      Integer maxPINLength,
284
      Set<Integer> authenticatorConfigCommands) {
285
    this.versions = versions;
286
    this.extensions = extensions;
287
    this.aaguid = aaguid;
288
    this.options = options;
289
    this.maxMsgSize = maxMsgSize;
290
    this.pinUvAuthProtocols = pinUvAuthProtocols;
291
    this.maxCredentialCountInList = maxCredentialCountInList;
292
    this.maxCredentialIdLength = maxCredentialIdLength;
293
    this.transports = transports;
294
    this.algorithms = algorithms;
295
    this.maxSerializedLargeBlobArray = maxSerializedLargeBlobArray;
296
    this.forcePINChange = forcePINChange;
297
    this.minPINLength = minPINLength;
298
    this.firmwareVersion = firmwareVersion;
299
    this.maxCredBlobLength = maxCredBlobLength;
300
    this.maxRPIDsForSetMinPINLength = maxRPIDsForSetMinPINLength;
301
    this.preferredPlatformUvAttempts = preferredPlatformUvAttempts;
302
    this.uvModality = uvModality;
303
    this.certifications = certifications;
304
    this.remainingDiscoverableCredentials = remainingDiscoverableCredentials;
305
    this.vendorPrototypeConfigCommands = vendorPrototypeConfigCommands;
306
    this.attestationFormats = attestationFormats;
307 1 1. <init> : negated conditional → SURVIVED
    this.longTouchForReset = longTouchForReset != null;
308
    this.uvCountSinceLastPinEntry = uvCountSinceLastPinEntry;
309
    this.transportsForReset = transportsForReset;
310 1 1. <init> : negated conditional → SURVIVED
    this.pinComplexityPolicy = pinComplexityPolicy != null;
311
    this.pinComplexityPolicyURL = pinComplexityPolicyURL;
312
    this.maxPINLength = maxPINLength;
313
    this.authenticatorConfigCommands = authenticatorConfigCommands;
314
  }
315
316
  /**
317
   * @see <a
318
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
319
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
320
   */
321
  public Optional<Set<String>> getExtensions() {
322 1 1. getExtensions : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getExtensions → SURVIVED
    return Optional.ofNullable(extensions);
323
  }
324
325
  /**
326
   * @see <a
327
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
328
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
329
   */
330
  public Optional<AAGUID> getAaguid() {
331 1 1. getAaguid : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getAaguid → SURVIVED
    return Optional.ofNullable(aaguid);
332
  }
333
334
  /**
335
   * @see <a
336
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
337
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
338
   */
339
  public Optional<SupportedCtapOptions> getOptions() {
340 1 1. getOptions : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getOptions → SURVIVED
    return Optional.ofNullable(options);
341
  }
342
343
  /**
344
   * @see <a
345
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
346
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
347
   */
348
  public Optional<Integer> getMaxMsgSize() {
349 1 1. getMaxMsgSize : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxMsgSize → SURVIVED
    return Optional.ofNullable(maxMsgSize);
350
  }
351
352
  /**
353
   * @see <a
354
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
355
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
356
   */
357
  public Optional<Set<CtapPinUvAuthProtocolVersion>> getPinUvAuthProtocols() {
358 1 1. getPinUvAuthProtocols : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getPinUvAuthProtocols → SURVIVED
    return Optional.ofNullable(pinUvAuthProtocols);
359
  }
360
361
  /**
362
   * @see <a
363
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
364
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
365
   */
366
  public Optional<Integer> getMaxCredentialCountInList() {
367 1 1. getMaxCredentialCountInList : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxCredentialCountInList → SURVIVED
    return Optional.ofNullable(maxCredentialCountInList);
368
  }
369
370
  /**
371
   * @see <a
372
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
373
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
374
   */
375
  public Optional<Integer> getMaxCredentialIdLength() {
376 1 1. getMaxCredentialIdLength : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxCredentialIdLength → SURVIVED
    return Optional.ofNullable(maxCredentialIdLength);
377
  }
378
379
  /**
380
   * @see <a
381
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
382
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
383
   */
384
  public Optional<Set<AuthenticatorTransport>> getTransports() {
385 1 1. getTransports : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getTransports → SURVIVED
    return Optional.ofNullable(transports);
386
  }
387
388
  /**
389
   * @see <a
390
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
391
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
392
   */
393
  public Optional<List<PublicKeyCredentialParameters>> getAlgorithms() {
394 1 1. getAlgorithms : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getAlgorithms → SURVIVED
    return Optional.ofNullable(algorithms);
395
  }
396
397
  /**
398
   * @see <a
399
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
400
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
401
   */
402
  public Optional<Integer> getMaxSerializedLargeBlobArray() {
403 1 1. getMaxSerializedLargeBlobArray : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxSerializedLargeBlobArray → SURVIVED
    return Optional.ofNullable(maxSerializedLargeBlobArray);
404
  }
405
406
  /**
407
   * @see <a
408
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
409
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
410
   */
411
  public Optional<Boolean> getForcePINChange() {
412 1 1. getForcePINChange : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getForcePINChange → SURVIVED
    return Optional.ofNullable(forcePINChange);
413
  }
414
415
  /**
416
   * @see <a
417
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
418
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
419
   */
420
  public Optional<Integer> getMinPINLength() {
421 1 1. getMinPINLength : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMinPINLength → SURVIVED
    return Optional.ofNullable(minPINLength);
422
  }
423
424
  /**
425
   * @see <a
426
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
427
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
428
   */
429
  public Optional<Integer> getFirmwareVersion() {
430 1 1. getFirmwareVersion : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getFirmwareVersion → SURVIVED
    return Optional.ofNullable(firmwareVersion);
431
  }
432
433
  /**
434
   * @see <a
435
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
436
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
437
   */
438
  public Optional<Integer> getMaxCredBlobLength() {
439 1 1. getMaxCredBlobLength : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxCredBlobLength → SURVIVED
    return Optional.ofNullable(maxCredBlobLength);
440
  }
441
442
  /**
443
   * @see <a
444
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
445
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
446
   */
447
  public Optional<Integer> getMaxRPIDsForSetMinPINLength() {
448 1 1. getMaxRPIDsForSetMinPINLength : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxRPIDsForSetMinPINLength → SURVIVED
    return Optional.ofNullable(maxRPIDsForSetMinPINLength);
449
  }
450
451
  /**
452
   * @see <a
453
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
454
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
455
   */
456
  public Optional<Integer> getPreferredPlatformUvAttempts() {
457 1 1. getPreferredPlatformUvAttempts : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getPreferredPlatformUvAttempts → SURVIVED
    return Optional.ofNullable(preferredPlatformUvAttempts);
458
  }
459
460
  /**
461
   * @see <a
462
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
463
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
464
   */
465
  public Optional<Set<UserVerificationMethod>> getUvModality() {
466 1 1. getUvModality : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getUvModality → SURVIVED
    return Optional.ofNullable(uvModality);
467
  }
468
469
  /**
470
   * @see <a
471
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
472
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
473
   */
474
  public Optional<Map<CtapCertificationId, Integer>> getCertifications() {
475 1 1. getCertifications : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getCertifications → SURVIVED
    return Optional.ofNullable(certifications);
476
  }
477
478
  /**
479
   * @see <a
480
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
481
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
482
   */
483
  public Optional<Integer> getRemainingDiscoverableCredentials() {
484 1 1. getRemainingDiscoverableCredentials : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getRemainingDiscoverableCredentials → SURVIVED
    return Optional.ofNullable(remainingDiscoverableCredentials);
485
  }
486
487
  /**
488
   * @see <a
489
   *     href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client
490
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
491
   */
492
  public Optional<Set<Integer>> getVendorPrototypeConfigCommands() {
493 1 1. getVendorPrototypeConfigCommands : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getVendorPrototypeConfigCommands → SURVIVED
    return Optional.ofNullable(vendorPrototypeConfigCommands);
494
  }
495
496
  /**
497
   * @since 2.9.0
498
   * @see <a
499
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
500
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
501
   */
502
  public Optional<List<String>> getAttestationFormats() {
503 1 1. getAttestationFormats : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getAttestationFormats → SURVIVED
    return Optional.ofNullable(attestationFormats);
504
  }
505
506
  /**
507
   * @since 2.9.0
508
   * @see <a
509
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
510
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
511
   */
512
  public Optional<Integer> getUvCountSinceLastPinEntry() {
513 1 1. getUvCountSinceLastPinEntry : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getUvCountSinceLastPinEntry → SURVIVED
    return Optional.ofNullable(uvCountSinceLastPinEntry);
514
  }
515
516
  /**
517
   * @since 2.9.0
518
   * @see <a
519
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
520
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
521
   */
522
  public Optional<Set<String>> getTransportsForReset() {
523 1 1. getTransportsForReset : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getTransportsForReset → SURVIVED
    return Optional.ofNullable(transportsForReset);
524
  }
525
526
  /**
527
   * @since 2.9.0
528
   * @see <a
529
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
530
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
531
   */
532
  public Optional<String> getPinComplexityPolicyURL() {
533 1 1. getPinComplexityPolicyURL : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getPinComplexityPolicyURL → SURVIVED
    return Optional.ofNullable(pinComplexityPolicyURL);
534
  }
535
536
  /**
537
   * @since 2.9.0
538
   * @see <a
539
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
540
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
541
   */
542
  public Optional<Integer> getMaxPINLength() {
543 1 1. getMaxPINLength : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxPINLength → SURVIVED
    return Optional.ofNullable(maxPINLength);
544
  }
545
546
  /**
547
   * @since 2.9.0
548
   * @see <a
549
   *     href="https://fidoalliance.org/specs/fido-v2.3-ps-20260226/fido-client-to-authenticator-protocol-v2.3-ps-20260226.html#authenticatorGetInfo">Client
550
   *     to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
551
   */
552
  public Optional<Set<Integer>> getAuthenticatorConfigCommands() {
553 1 1. getAuthenticatorConfigCommands : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getAuthenticatorConfigCommands → SURVIVED
    return Optional.ofNullable(authenticatorConfigCommands);
554
  }
555
556
  private static class SetFromIntJsonDeserializer
557
      extends JsonDeserializer<Set<UserVerificationMethod>> {
558
    @Override
559
    public Set<UserVerificationMethod> deserialize(JsonParser p, DeserializationContext ctxt)
560
        throws IOException {
561
      final int bitset = p.getNumberValue().intValue();
562 1 1. deserialize : replaced return value with Collections.emptySet for com/yubico/fido/metadata/AuthenticatorGetInfo$SetFromIntJsonDeserializer::deserialize → KILLED
      return Arrays.stream(UserVerificationMethod.values())
563 3 1. lambda$deserialize$0 : Replaced bitwise AND with OR → KILLED
2. lambda$deserialize$0 : negated conditional → KILLED
3. lambda$deserialize$0 : replaced boolean return with true for com/yubico/fido/metadata/AuthenticatorGetInfo$SetFromIntJsonDeserializer::lambda$deserialize$0 → KILLED
          .filter(uvm -> (uvm.getValue() & bitset) != 0)
564
          .collect(Collectors.toSet());
565
    }
566
  }
567
568
  private static class IntFromSetJsonSerializer
569
      extends JsonSerializer<Set<UserVerificationMethod>> {
570
    @Override
571
    public void serialize(
572
        Set<UserVerificationMethod> value, JsonGenerator gen, SerializerProvider serializers)
573
        throws IOException {
574 1 1. serialize : removed call to com/fasterxml/jackson/core/JsonGenerator::writeNumber → KILLED
      gen.writeNumber(
575 4 1. lambda$serialize$1 : Replaced bitwise OR with AND → NO_COVERAGE
2. lambda$serialize$1 : replaced Integer return value with 0 for com/yubico/fido/metadata/AuthenticatorGetInfo$IntFromSetJsonSerializer::lambda$serialize$1 → NO_COVERAGE
3. lambda$serialize$0 : replaced Integer return value with 0 for com/yubico/fido/metadata/AuthenticatorGetInfo$IntFromSetJsonSerializer::lambda$serialize$0 → KILLED
4. lambda$serialize$0 : Replaced bitwise OR with AND → KILLED
          value.stream().reduce(0, (acc, next) -> acc | next.getValue(), (a, b) -> a | b));
576
    }
577
  }
578
579
  @Value
580
  @JsonDeserialize(using = PublicKeyCredentialParametersIgnoringUnknownValues.Deserializer.class)
581
  private static class PublicKeyCredentialParametersIgnoringUnknownValues {
582
    PublicKeyCredentialParameters value;
583
584
    private static class Deserializer
585
        extends JsonDeserializer<PublicKeyCredentialParametersIgnoringUnknownValues> {
586
      @Override
587
      public PublicKeyCredentialParametersIgnoringUnknownValues deserialize(
588
          JsonParser p, DeserializationContext ctxt) throws IOException, JacksonException {
589
        try {
590 1 1. deserialize : replaced return value with null for com/yubico/fido/metadata/AuthenticatorGetInfo$PublicKeyCredentialParametersIgnoringUnknownValues$Deserializer::deserialize → KILLED
          return new PublicKeyCredentialParametersIgnoringUnknownValues(
591
              p.readValueAs(PublicKeyCredentialParameters.class));
592
        } catch (IOException e) {
593
          return null;
594
        }
595
      }
596
    }
597
  }
598
599
  private static class ListPublicKeyCredentialParametersIgnoringUnknownValuesDeserializer
600
      extends JsonDeserializer<List<PublicKeyCredentialParameters>> {
601
    @Override
602
    public List<PublicKeyCredentialParameters> deserialize(
603
        JsonParser p, DeserializationContext ctxt) throws IOException {
604
      PublicKeyCredentialParametersIgnoringUnknownValues[] pkcpiuvs =
605
          p.readValueAs(PublicKeyCredentialParametersIgnoringUnknownValues[].class);
606 1 1. deserialize : replaced return value with Collections.emptyList for com/yubico/fido/metadata/AuthenticatorGetInfo$ListPublicKeyCredentialParametersIgnoringUnknownValuesDeserializer::deserialize → KILLED
      return Arrays.stream(pkcpiuvs)
607
          .flatMap(
608
              pkcpiuv -> {
609 2 1. lambda$deserialize$0 : negated conditional → KILLED
2. lambda$deserialize$0 : negated conditional → KILLED
                if (pkcpiuv != null && pkcpiuv.value != null) {
610 1 1. lambda$deserialize$0 : replaced return value with Stream.empty for com/yubico/fido/metadata/AuthenticatorGetInfo$ListPublicKeyCredentialParametersIgnoringUnknownValuesDeserializer::lambda$deserialize$0 → KILLED
                  return Stream.of(pkcpiuv.value);
611
                } else {
612
                  return Stream.empty();
613
                }
614
              })
615
          .collect(Collectors.toList());
616
    }
617
  }
618
}

Mutations

256

1.1
Location : <init>
Killed by : com.yubico.fido.metadata.JsonIoSpec
negated conditional → KILLED

307

1.1
Location : <init>
Killed by : none
negated conditional → SURVIVED

310

1.1
Location : <init>
Killed by : none
negated conditional → SURVIVED

322

1.1
Location : getExtensions
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getExtensions → SURVIVED

331

1.1
Location : getAaguid
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getAaguid → SURVIVED

340

1.1
Location : getOptions
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getOptions → SURVIVED

349

1.1
Location : getMaxMsgSize
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxMsgSize → SURVIVED

358

1.1
Location : getPinUvAuthProtocols
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getPinUvAuthProtocols → SURVIVED

367

1.1
Location : getMaxCredentialCountInList
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxCredentialCountInList → SURVIVED

376

1.1
Location : getMaxCredentialIdLength
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxCredentialIdLength → SURVIVED

385

1.1
Location : getTransports
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getTransports → SURVIVED

394

1.1
Location : getAlgorithms
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getAlgorithms → SURVIVED

403

1.1
Location : getMaxSerializedLargeBlobArray
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxSerializedLargeBlobArray → SURVIVED

412

1.1
Location : getForcePINChange
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getForcePINChange → SURVIVED

421

1.1
Location : getMinPINLength
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMinPINLength → SURVIVED

430

1.1
Location : getFirmwareVersion
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getFirmwareVersion → SURVIVED

439

1.1
Location : getMaxCredBlobLength
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxCredBlobLength → SURVIVED

448

1.1
Location : getMaxRPIDsForSetMinPINLength
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxRPIDsForSetMinPINLength → SURVIVED

457

1.1
Location : getPreferredPlatformUvAttempts
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getPreferredPlatformUvAttempts → SURVIVED

466

1.1
Location : getUvModality
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getUvModality → SURVIVED

475

1.1
Location : getCertifications
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getCertifications → SURVIVED

484

1.1
Location : getRemainingDiscoverableCredentials
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getRemainingDiscoverableCredentials → SURVIVED

493

1.1
Location : getVendorPrototypeConfigCommands
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getVendorPrototypeConfigCommands → SURVIVED

503

1.1
Location : getAttestationFormats
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getAttestationFormats → SURVIVED

513

1.1
Location : getUvCountSinceLastPinEntry
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getUvCountSinceLastPinEntry → SURVIVED

523

1.1
Location : getTransportsForReset
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getTransportsForReset → SURVIVED

533

1.1
Location : getPinComplexityPolicyURL
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getPinComplexityPolicyURL → SURVIVED

543

1.1
Location : getMaxPINLength
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxPINLength → SURVIVED

553

1.1
Location : getAuthenticatorConfigCommands
Killed by : none
replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getAuthenticatorConfigCommands → SURVIVED

562

1.1
Location : deserialize
Killed by : com.yubico.fido.metadata.JsonIoSpec
replaced return value with Collections.emptySet for com/yubico/fido/metadata/AuthenticatorGetInfo$SetFromIntJsonDeserializer::deserialize → KILLED

563

1.1
Location : lambda$deserialize$0
Killed by : com.yubico.fido.metadata.JsonIoSpec
Replaced bitwise AND with OR → KILLED

2.2
Location : lambda$deserialize$0
Killed by : com.yubico.fido.metadata.JsonIoSpec
negated conditional → KILLED

3.3
Location : lambda$deserialize$0
Killed by : com.yubico.fido.metadata.JsonIoSpec
replaced boolean return with true for com/yubico/fido/metadata/AuthenticatorGetInfo$SetFromIntJsonDeserializer::lambda$deserialize$0 → KILLED

574

1.1
Location : serialize
Killed by : com.yubico.fido.metadata.JsonIoSpec
removed call to com/fasterxml/jackson/core/JsonGenerator::writeNumber → KILLED

575

1.1
Location : lambda$serialize$1
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

2.2
Location : lambda$serialize$0
Killed by : com.yubico.fido.metadata.JsonIoSpec
replaced Integer return value with 0 for com/yubico/fido/metadata/AuthenticatorGetInfo$IntFromSetJsonSerializer::lambda$serialize$0 → KILLED

3.3
Location : lambda$serialize$1
Killed by : none
replaced Integer return value with 0 for com/yubico/fido/metadata/AuthenticatorGetInfo$IntFromSetJsonSerializer::lambda$serialize$1 → NO_COVERAGE

4.4
Location : lambda$serialize$0
Killed by : com.yubico.fido.metadata.JsonIoSpec
Replaced bitwise OR with AND → KILLED

590

1.1
Location : deserialize
Killed by : com.yubico.fido.metadata.JsonIoSpec
replaced return value with null for com/yubico/fido/metadata/AuthenticatorGetInfo$PublicKeyCredentialParametersIgnoringUnknownValues$Deserializer::deserialize → KILLED

606

1.1
Location : deserialize
Killed by : com.yubico.fido.metadata.JsonIoSpec
replaced return value with Collections.emptyList for com/yubico/fido/metadata/AuthenticatorGetInfo$ListPublicKeyCredentialParametersIgnoringUnknownValuesDeserializer::deserialize → KILLED

609

1.1
Location : lambda$deserialize$0
Killed by : com.yubico.fido.metadata.JsonIoSpec
negated conditional → KILLED

2.2
Location : lambda$deserialize$0
Killed by : com.yubico.fido.metadata.JsonIoSpec
negated conditional → KILLED

610

1.1
Location : lambda$deserialize$0
Killed by : com.yubico.fido.metadata.JsonIoSpec
replaced return value with Stream.empty for com/yubico/fido/metadata/AuthenticatorGetInfo$ListPublicKeyCredentialParametersIgnoringUnknownValuesDeserializer::lambda$deserialize$0 → KILLED

Active mutators

Tests examined


Report generated by PIT 1.15.0