-
Notifications
You must be signed in to change notification settings - Fork 166
Expand file tree
/
Copy pathSupportedCtapOptions.java
More file actions
226 lines (203 loc) · 9.46 KB
/
SupportedCtapOptions.java
File metadata and controls
226 lines (203 loc) · 9.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
package com.yubico.fido.metadata;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Builder;
import lombok.Value;
/**
* A fixed-keys map of CTAP2 option names to Boolean values representing whether an authenticator
* supports the respective option.
*
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
@Value
@Builder
public class SupportedCtapOptions {
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean plat;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean rk;
/**
* If set to <code>true</code> the device is capable of accepting PIN.
*
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
boolean clientPin;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean up;
/**
* If set to <code>true</code> the device is capable of built-in user verification.
*
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
boolean uv;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean pinUvAuthToken;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean noMcGaPermissionsWithClientPin;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean largeBlobs;
/**
* If set to <code>true</code> the authenticator is enterprise attestation capable.
*
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
boolean ep;
/**
* If set to <code>true</code> the authenticator supports the authenticatorBioEnrollment commands.
*
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
boolean bioEnroll;
/**
* If set to <code>true</code> the authenticator supports the Prototype authenticatorBioEnrollment
* (0x40) commands.
*
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
boolean userVerificationMgmtPreview;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean uvBioEnroll;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean authnrCfg;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean uvAcfg;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean credMgmt;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean perCredMgmtRO;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
boolean credentialMgmtPreview;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean setMinPINLength;
/**
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
boolean makeCredUvNotRqd;
/**
* If set to <code>true</code> the authenticator supports the Always Require User Verification
* feature.
*
* @see <a
* href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
boolean alwaysUv;
@JsonCreator
private SupportedCtapOptions(
@JsonProperty("plat") Boolean plat,
@JsonProperty("rk") Boolean rk,
@JsonProperty("clientPin") Boolean clientPin,
@JsonProperty("up") Boolean up,
@JsonProperty("uv") Boolean uv,
@JsonAlias("uvToken") @JsonProperty("pinUvAuthToken") Boolean pinUvAuthToken,
@JsonProperty("noMcGaPermissionsWithClientPin") Boolean noMcGaPermissionsWithClientPin,
@JsonProperty("largeBlobs") Boolean largeBlobs,
@JsonProperty("ep") Boolean ep,
@JsonProperty("bioEnroll") Boolean bioEnroll,
@JsonProperty("userVerificationMgmtPreview") Boolean userVerificationMgmtPreview,
@JsonProperty("uvBioEnroll") Boolean uvBioEnroll,
@JsonAlias("config") @JsonProperty("authnrCfg") Boolean authnrCfg,
@JsonProperty("uvAcfg") Boolean uvAcfg,
@JsonProperty("credMgmt") Boolean credMgmt,
@JsonProperty("perCredMgmtRO") Boolean perCredMgmtRO,
@JsonProperty("credentialMgmtPreview") Boolean credentialMgmtPreview,
@JsonProperty("setMinPINLength") Boolean setMinPINLength,
@JsonProperty("makeCredUvNotRqd") Boolean makeCredUvNotRqd,
@JsonProperty("alwaysUv") Boolean alwaysUv) {
this.plat = Boolean.TRUE.equals(plat);
this.rk = Boolean.TRUE.equals(rk);
this.clientPin = clientPin != null;
this.up = Boolean.TRUE.equals(up);
this.uv = uv != null;
this.pinUvAuthToken = Boolean.TRUE.equals(pinUvAuthToken);
this.noMcGaPermissionsWithClientPin = Boolean.TRUE.equals(noMcGaPermissionsWithClientPin);
this.largeBlobs = Boolean.TRUE.equals(largeBlobs);
this.ep = ep != null;
this.bioEnroll = bioEnroll != null;
this.userVerificationMgmtPreview = userVerificationMgmtPreview != null;
this.uvBioEnroll = Boolean.TRUE.equals(uvBioEnroll);
this.authnrCfg = Boolean.TRUE.equals(authnrCfg);
this.uvAcfg = Boolean.TRUE.equals(uvAcfg);
this.credMgmt = Boolean.TRUE.equals(credMgmt);
this.perCredMgmtRO = Boolean.TRUE.equals(perCredMgmtRO);
this.credentialMgmtPreview = Boolean.TRUE.equals(credentialMgmtPreview);
this.setMinPINLength = Boolean.TRUE.equals(setMinPINLength);
this.makeCredUvNotRqd = Boolean.TRUE.equals(makeCredUvNotRqd);
this.alwaysUv = alwaysUv != null;
}
}