| 1 | // Copyright (c) 2018, Yubico AB | |
| 2 | // All rights reserved. | |
| 3 | // | |
| 4 | // Redistribution and use in source and binary forms, with or without | |
| 5 | // modification, are permitted provided that the following conditions are met: | |
| 6 | // | |
| 7 | // 1. Redistributions of source code must retain the above copyright notice, this | |
| 8 | // list of conditions and the following disclaimer. | |
| 9 | // | |
| 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, | |
| 11 | // this list of conditions and the following disclaimer in the documentation | |
| 12 | // and/or other materials provided with the distribution. | |
| 13 | // | |
| 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
| 15 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 16 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 17 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |
| 18 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
| 19 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 20 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |
| 21 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
| 22 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 23 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 24 | ||
| 25 | package com.yubico.webauthn.data; | |
| 26 | ||
| 27 | import com.fasterxml.jackson.annotation.JsonCreator; | |
| 28 | import com.fasterxml.jackson.annotation.JsonIgnore; | |
| 29 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 30 | import com.fasterxml.jackson.annotation.JsonProperty; | |
| 31 | import com.yubico.webauthn.RelyingParty; | |
| 32 | import com.yubico.webauthn.StartRegistrationOptions; | |
| 33 | import com.yubico.webauthn.extension.appid.AppId; | |
| 34 | import java.util.Collections; | |
| 35 | import java.util.HashSet; | |
| 36 | import java.util.Optional; | |
| 37 | import java.util.Set; | |
| 38 | import lombok.Builder; | |
| 39 | import lombok.Value; | |
| 40 | ||
| 41 | /** | |
| 42 | * Contains <a | |
| 43 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#client-extension-input">client | |
| 44 | * extension inputs</a> to a <code>navigator.credentials.create()</code> operation. All members are | |
| 45 | * optional. | |
| 46 | * | |
| 47 | * <p>The authenticator extension inputs are derived from these client extension inputs. | |
| 48 | * | |
| 49 | * @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-extensions">§9. WebAuthn | |
| 50 | * Extensions</a> | |
| 51 | */ | |
| 52 | @Value | |
| 53 | @Builder(toBuilder = true) | |
| 54 | @JsonIgnoreProperties(ignoreUnknown = true) | |
| 55 | public final class RegistrationExtensionInputs implements ExtensionInputs { | |
| 56 | ||
| 57 | private final AppId appidExclude; | |
| 58 | private final Boolean credProps; | |
| 59 | private final Extensions.CredentialProtection.CredentialProtectionInput credProtect; | |
| 60 | private final Extensions.LargeBlob.LargeBlobRegistrationInput largeBlob; | |
| 61 | private final Extensions.Prf.PrfRegistrationInput prf; | |
| 62 | private final Boolean uvm; | |
| 63 | ||
| 64 | private RegistrationExtensionInputs( | |
| 65 | AppId appidExclude, | |
| 66 | Boolean credProps, | |
| 67 | Extensions.CredentialProtection.CredentialProtectionInput credProtect, | |
| 68 | Extensions.LargeBlob.LargeBlobRegistrationInput largeBlob, | |
| 69 | Extensions.Prf.PrfRegistrationInput prf, | |
| 70 | Boolean uvm) { | |
| 71 | this.appidExclude = appidExclude; | |
| 72 | this.credProps = credProps; | |
| 73 | this.credProtect = credProtect; | |
| 74 | this.largeBlob = largeBlob; | |
| 75 | this.prf = prf; | |
| 76 | this.uvm = uvm; | |
| 77 | } | |
| 78 | ||
| 79 | @JsonCreator | |
| 80 | private RegistrationExtensionInputs( | |
| 81 | @JsonProperty("appidExclude") AppId appidExclude, | |
| 82 | @JsonProperty("credProps") Boolean credProps, | |
| 83 | @JsonProperty("credentialProtectionPolicy") | |
| 84 | Extensions.CredentialProtection.CredentialProtectionPolicy credProtectPolicy, | |
| 85 | @JsonProperty("enforceCredentialProtectionPolicy") Boolean enforceCredProtectPolicy, | |
| 86 | @JsonProperty("largeBlob") Extensions.LargeBlob.LargeBlobRegistrationInput largeBlob, | |
| 87 | @JsonProperty("prf") Extensions.Prf.PrfRegistrationInput prf, | |
| 88 | @JsonProperty("uvm") Boolean uvm) { | |
| 89 | this( | |
| 90 | appidExclude, | |
| 91 | credProps, | |
| 92 | Optional.ofNullable(credProtectPolicy) | |
| 93 | .map( | |
| 94 | policy -> { | |
| 95 |
3
1. lambda$new$0 : negated conditional → KILLED 2. lambda$new$0 : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs::lambda$new$0 → KILLED 3. lambda$new$0 : negated conditional → KILLED |
return enforceCredProtectPolicy != null && enforceCredProtectPolicy |
| 96 | ? Extensions.CredentialProtection.CredentialProtectionInput.require(policy) | |
| 97 | : Extensions.CredentialProtection.CredentialProtectionInput.prefer(policy); | |
| 98 | }) | |
| 99 | .orElse(null), | |
| 100 | largeBlob, | |
| 101 | prf, | |
| 102 | uvm); | |
| 103 | } | |
| 104 | ||
| 105 | /** | |
| 106 | * Merge <code>other</code> into <code>this</code>. Non-null field values from <code>this</code> | |
| 107 | * take precedence. | |
| 108 | * | |
| 109 | * @return a new {@link RegistrationExtensionInputs} instance with the settings from both <code> | |
| 110 | * this</code> and <code>other</code>. | |
| 111 | */ | |
| 112 | public RegistrationExtensionInputs merge(RegistrationExtensionInputs other) { | |
| 113 |
1
1. merge : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs::merge → KILLED |
return new RegistrationExtensionInputs( |
| 114 |
1
1. merge : negated conditional → KILLED |
this.appidExclude != null ? this.appidExclude : other.appidExclude, |
| 115 |
1
1. merge : negated conditional → KILLED |
this.credProps != null ? this.credProps : other.credProps, |
| 116 |
1
1. merge : negated conditional → KILLED |
this.credProtect != null ? this.credProtect : other.credProtect, |
| 117 |
1
1. merge : negated conditional → SURVIVED |
this.largeBlob != null ? this.largeBlob : other.largeBlob, |
| 118 |
1
1. merge : negated conditional → KILLED |
this.prf != null ? this.prf : other.prf, |
| 119 |
1
1. merge : negated conditional → KILLED |
this.uvm != null ? this.uvm : other.uvm); |
| 120 | } | |
| 121 | ||
| 122 | /** | |
| 123 | * @return The value of the FIDO AppID Exclusion Extension (<code>appidExclude</code>) input if | |
| 124 | * configured, empty otherwise. | |
| 125 | * @see RegistrationExtensionInputsBuilder#appidExclude(AppId) | |
| 126 | * @see <a | |
| 127 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-appid-exclude-extension">§10.2. | |
| 128 | * FIDO AppID Exclusion Extension (appidExclude)</a> | |
| 129 | */ | |
| 130 | public Optional<AppId> getAppidExclude() { | |
| 131 |
1
1. getAppidExclude : replaced return value with Optional.empty for com/yubico/webauthn/data/RegistrationExtensionInputs::getAppidExclude → KILLED |
return Optional.ofNullable(appidExclude); |
| 132 | } | |
| 133 | ||
| 134 | /** | |
| 135 | * @return <code>true</code> if the Credential Properties Extension (<code>credProps</code>) is | |
| 136 | * enabled, <code>false</code> otherwise. | |
| 137 | * @see RegistrationExtensionInputsBuilder#credProps() | |
| 138 | * @see <a | |
| 139 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-authenticator-credential-properties-extension">§10.4. | |
| 140 | * Credential Properties Extension (credProps)</a> | |
| 141 | */ | |
| 142 | public boolean getCredProps() { | |
| 143 |
3
1. getCredProps : negated conditional → KILLED 2. getCredProps : replaced boolean return with true for com/yubico/webauthn/data/RegistrationExtensionInputs::getCredProps → KILLED 3. getCredProps : negated conditional → KILLED |
return credProps != null && credProps; |
| 144 | } | |
| 145 | ||
| 146 | /** For JSON serialization, to omit false values. */ | |
| 147 | @JsonProperty("credProps") | |
| 148 | private Boolean getCredPropsJson() { | |
| 149 |
3
1. getCredPropsJson : negated conditional → KILLED 2. getCredPropsJson : replaced Boolean return with False for com/yubico/webauthn/data/RegistrationExtensionInputs::getCredPropsJson → KILLED 3. getCredPropsJson : replaced Boolean return with True for com/yubico/webauthn/data/RegistrationExtensionInputs::getCredPropsJson → KILLED |
return getCredProps() ? true : null; |
| 150 | } | |
| 151 | ||
| 152 | /** | |
| 153 | * @return The Credential Protection (<code>credProtect</code>) extension input, if set. | |
| 154 | * @since 2.7.0 | |
| 155 | * @see | |
| 156 | * RegistrationExtensionInputsBuilder#credProtect(Extensions.CredentialProtection.CredentialProtectionInput) | |
| 157 | * @see <a | |
| 158 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-authenticator-credential-properties-extension">§10.4. | |
| 159 | * Credential Properties Extension (credProps)</a> | |
| 160 | */ | |
| 161 | @JsonIgnore | |
| 162 | public Optional<Extensions.CredentialProtection.CredentialProtectionInput> getCredProtect() { | |
| 163 |
1
1. getCredProtect : replaced return value with Optional.empty for com/yubico/webauthn/data/RegistrationExtensionInputs::getCredProtect → KILLED |
return Optional.ofNullable(credProtect); |
| 164 | } | |
| 165 | ||
| 166 | /** | |
| 167 | * For JSON serialization, because credProtect does not group all inputs under the "credProtect" | |
| 168 | * key. | |
| 169 | */ | |
| 170 | @JsonProperty("credentialProtectionPolicy") | |
| 171 | private Optional<Extensions.CredentialProtection.CredentialProtectionPolicy> | |
| 172 | getCredProtectPolicy() { | |
| 173 |
1
1. getCredProtectPolicy : replaced return value with Optional.empty for com/yubico/webauthn/data/RegistrationExtensionInputs::getCredProtectPolicy → KILLED |
return getCredProtect() |
| 174 | .map( | |
| 175 | Extensions.CredentialProtection.CredentialProtectionInput | |
| 176 | ::getCredentialProtectionPolicy); | |
| 177 | } | |
| 178 | ||
| 179 | /** | |
| 180 | * For JSON serialization, because credProtect does not group all inputs under the "credProtect" | |
| 181 | * key. | |
| 182 | */ | |
| 183 | @JsonProperty("enforceCredentialProtectionPolicy") | |
| 184 | private Optional<Boolean> getEnforceCredProtectPolicy() { | |
| 185 |
1
1. getEnforceCredProtectPolicy : replaced return value with Optional.empty for com/yubico/webauthn/data/RegistrationExtensionInputs::getEnforceCredProtectPolicy → KILLED |
return getCredProtect() |
| 186 | .map( | |
| 187 | Extensions.CredentialProtection.CredentialProtectionInput | |
| 188 | ::isEnforceCredentialProtectionPolicy); | |
| 189 | } | |
| 190 | ||
| 191 | /** | |
| 192 | * @return The value of the Large blob storage extension (<code>largeBlob</code>) input if | |
| 193 | * configured, empty otherwise. | |
| 194 | * @see | |
| 195 | * RegistrationExtensionInputsBuilder#largeBlob(Extensions.LargeBlob.LargeBlobRegistrationInput) | |
| 196 | * @see | |
| 197 | * RegistrationExtensionInputsBuilder#largeBlob(Extensions.LargeBlob.LargeBlobRegistrationInput.LargeBlobSupport) | |
| 198 | * @see <a | |
| 199 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-large-blob-extension">§10.5. | |
| 200 | * Large blob storage extension (largeBlob)</a> | |
| 201 | */ | |
| 202 | public Optional<Extensions.LargeBlob.LargeBlobRegistrationInput> getLargeBlob() { | |
| 203 |
1
1. getLargeBlob : replaced return value with Optional.empty for com/yubico/webauthn/data/RegistrationExtensionInputs::getLargeBlob → KILLED |
return Optional.ofNullable(largeBlob); |
| 204 | } | |
| 205 | ||
| 206 | /** | |
| 207 | * The input to the Pseudo-random function extension (<code>prf</code>), if any. | |
| 208 | * | |
| 209 | * <p>This extension allows a Relying Party to evaluate outputs from a pseudo-random function | |
| 210 | * (PRF) associated with a credential. | |
| 211 | * | |
| 212 | * @since 2.7.0 | |
| 213 | * @see Extensions.Prf.PrfRegistrationInput#enable() | |
| 214 | * @see Extensions.Prf.PrfRegistrationInput#eval(Extensions.Prf.PrfValues) | |
| 215 | * @see <a href="https://www.w3.org/TR/2025/WD-webauthn-3-20250127/#prf-extension">§10.1.4. | |
| 216 | * Pseudo-random function extension (prf)</a> | |
| 217 | */ | |
| 218 | public Optional<Extensions.Prf.PrfRegistrationInput> getPrf() { | |
| 219 |
1
1. getPrf : replaced return value with Optional.empty for com/yubico/webauthn/data/RegistrationExtensionInputs::getPrf → KILLED |
return Optional.ofNullable(prf); |
| 220 | } | |
| 221 | ||
| 222 | /** | |
| 223 | * @return <code>true</code> if the User Verification Method Extension (<code>uvm</code>) is | |
| 224 | * enabled, <code>false</code> otherwise. | |
| 225 | * @see RegistrationExtensionInputsBuilder#uvm() | |
| 226 | * @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-uvm-extension">§10.3. | |
| 227 | * User Verification Method Extension (uvm)</a> | |
| 228 | */ | |
| 229 | public boolean getUvm() { | |
| 230 |
3
1. getUvm : negated conditional → KILLED 2. getUvm : negated conditional → KILLED 3. getUvm : replaced boolean return with true for com/yubico/webauthn/data/RegistrationExtensionInputs::getUvm → KILLED |
return uvm != null && uvm; |
| 231 | } | |
| 232 | ||
| 233 | /** For JSON serialization, to omit false values. */ | |
| 234 | @JsonProperty("uvm") | |
| 235 | private Boolean getUvmJson() { | |
| 236 |
3
1. getUvmJson : replaced Boolean return with False for com/yubico/webauthn/data/RegistrationExtensionInputs::getUvmJson → KILLED 2. getUvmJson : replaced Boolean return with True for com/yubico/webauthn/data/RegistrationExtensionInputs::getUvmJson → KILLED 3. getUvmJson : negated conditional → KILLED |
return getUvm() ? true : null; |
| 237 | } | |
| 238 | ||
| 239 | /** | |
| 240 | * @return The extension identifiers of all extensions configured. | |
| 241 | * @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-extension-id">§9.1. | |
| 242 | * Extension Identifiers</a> | |
| 243 | */ | |
| 244 | @Override | |
| 245 | public Set<String> getExtensionIds() { | |
| 246 | Set<String> ids = new HashSet<>(); | |
| 247 |
1
1. getExtensionIds : negated conditional → KILLED |
if (appidExclude != null) { |
| 248 | ids.add(Extensions.AppidExclude.EXTENSION_ID); | |
| 249 | } | |
| 250 |
1
1. getExtensionIds : negated conditional → KILLED |
if (getCredProps()) { |
| 251 | ids.add(Extensions.CredentialProperties.EXTENSION_ID); | |
| 252 | } | |
| 253 |
1
1. getExtensionIds : negated conditional → KILLED |
if (getCredProtect().isPresent()) { |
| 254 | ids.add(Extensions.CredentialProtection.EXTENSION_ID); | |
| 255 | } | |
| 256 |
1
1. getExtensionIds : negated conditional → KILLED |
if (largeBlob != null) { |
| 257 | ids.add(Extensions.LargeBlob.EXTENSION_ID); | |
| 258 | } | |
| 259 |
1
1. getExtensionIds : negated conditional → KILLED |
if (prf != null) { |
| 260 | ids.add(Extensions.Prf.EXTENSION_ID); | |
| 261 | } | |
| 262 |
1
1. getExtensionIds : negated conditional → KILLED |
if (getUvm()) { |
| 263 | ids.add(Extensions.Uvm.EXTENSION_ID); | |
| 264 | } | |
| 265 |
1
1. getExtensionIds : replaced return value with Collections.emptySet for com/yubico/webauthn/data/RegistrationExtensionInputs::getExtensionIds → KILLED |
return Collections.unmodifiableSet(ids); |
| 266 | } | |
| 267 | ||
| 268 | public static class RegistrationExtensionInputsBuilder { | |
| 269 | /** | |
| 270 | * Enable or disable the FIDO AppID Exclusion Extension (<code>appidExclude</code>). | |
| 271 | * | |
| 272 | * <p>You usually do not need to call this method explicitly; if {@link RelyingParty#getAppId()} | |
| 273 | * is present, then {@link RelyingParty#startRegistration(StartRegistrationOptions)} will enable | |
| 274 | * this extension automatically. | |
| 275 | * | |
| 276 | * <p>If this is set to empty, then {@link | |
| 277 | * RelyingParty#startRegistration(StartRegistrationOptions)} may overwrite it. | |
| 278 | * | |
| 279 | * @see RelyingParty#startRegistration(StartRegistrationOptions) | |
| 280 | * @see <a | |
| 281 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-appid-exclude-extension">§10.2. | |
| 282 | * FIDO AppID Exclusion Extension (appidExclude)</a> | |
| 283 | */ | |
| 284 | public RegistrationExtensionInputsBuilder appidExclude(Optional<AppId> appidExclude) { | |
| 285 | this.appidExclude = appidExclude.orElse(null); | |
| 286 |
1
1. appidExclude : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs$RegistrationExtensionInputsBuilder::appidExclude → KILLED |
return this; |
| 287 | } | |
| 288 | ||
| 289 | /** | |
| 290 | * Enable the FIDO AppID Exclusion Extension (<code>appidExclude</code>). | |
| 291 | * | |
| 292 | * <p>You usually do not need to call this method explicitly; if {@link RelyingParty#getAppId()} | |
| 293 | * is present, then {@link RelyingParty#startRegistration(StartRegistrationOptions)} will enable | |
| 294 | * this extension automatically. | |
| 295 | * | |
| 296 | * <p>If this is set to null, then {@link | |
| 297 | * RelyingParty#startRegistration(StartRegistrationOptions)} may overwrite it. | |
| 298 | * | |
| 299 | * @see RelyingParty#startRegistration(StartRegistrationOptions) | |
| 300 | * @see <a | |
| 301 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-appid-exclude-extension">§10.2. | |
| 302 | * FIDO AppID Exclusion Extension (appidExclude)</a> | |
| 303 | */ | |
| 304 | public RegistrationExtensionInputsBuilder appidExclude(AppId appidExclude) { | |
| 305 | this.appidExclude = appidExclude; | |
| 306 |
1
1. appidExclude : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs$RegistrationExtensionInputsBuilder::appidExclude → KILLED |
return this; |
| 307 | } | |
| 308 | ||
| 309 | /** | |
| 310 | * Enable the Credential Properties (<code>credProps</code>) Extension. | |
| 311 | * | |
| 312 | * @see <a | |
| 313 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-authenticator-credential-properties-extension">§10.4. | |
| 314 | * Credential Properties Extension (credProps)</a> | |
| 315 | */ | |
| 316 | public RegistrationExtensionInputsBuilder credProps() { | |
| 317 | this.credProps = true; | |
| 318 |
1
1. credProps : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs$RegistrationExtensionInputsBuilder::credProps → KILLED |
return this; |
| 319 | } | |
| 320 | ||
| 321 | /** | |
| 322 | * Enable or disable the Credential Properties (<code>credProps</code>) Extension. | |
| 323 | * | |
| 324 | * <p>A <code>true</code> argument enables the extension. A <code>false</code> argument disables | |
| 325 | * the extension, and will not be overwritten by {@link | |
| 326 | * RelyingParty#startRegistration(StartRegistrationOptions)}. A null argument disables the | |
| 327 | * extension, and will be overwritten by {@link | |
| 328 | * RelyingParty#startRegistration(StartRegistrationOptions)}. | |
| 329 | * | |
| 330 | * @see RelyingParty#startRegistration(StartRegistrationOptions) | |
| 331 | * @see <a | |
| 332 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-authenticator-credential-properties-extension">§10.4. | |
| 333 | * Credential Properties Extension (credProps)</a> | |
| 334 | */ | |
| 335 | public RegistrationExtensionInputsBuilder credProps(Boolean credProps) { | |
| 336 | this.credProps = credProps; | |
| 337 |
1
1. credProps : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs$RegistrationExtensionInputsBuilder::credProps → KILLED |
return this; |
| 338 | } | |
| 339 | ||
| 340 | /** | |
| 341 | * Enable or disable the Credential Protection (<code>credProtect</code>) extension. | |
| 342 | * | |
| 343 | * @since 2.7.0 | |
| 344 | * @see | |
| 345 | * Extensions.CredentialProtection.CredentialProtectionInput#prefer(Extensions.CredentialProtection.CredentialProtectionPolicy) | |
| 346 | * @see | |
| 347 | * Extensions.CredentialProtection.CredentialProtectionInput#require(Extensions.CredentialProtection.CredentialProtectionPolicy) | |
| 348 | * @see <a | |
| 349 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-credProtect-extension">CTAP2 | |
| 350 | * §12.1. Credential Protection (credProtect)</a> | |
| 351 | */ | |
| 352 | public RegistrationExtensionInputsBuilder credProtect( | |
| 353 | Optional<Extensions.CredentialProtection.CredentialProtectionInput> credProtect) { | |
| 354 | this.credProtect = credProtect.orElse(null); | |
| 355 |
1
1. credProtect : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs$RegistrationExtensionInputsBuilder::credProtect → KILLED |
return this; |
| 356 | } | |
| 357 | ||
| 358 | /** | |
| 359 | * Enable the Credential Protection (<code>credProtect</code>) extension. | |
| 360 | * | |
| 361 | * @since 2.7.0 | |
| 362 | * @see | |
| 363 | * Extensions.CredentialProtection.CredentialProtectionInput#prefer(Extensions.CredentialProtection.CredentialProtectionPolicy) | |
| 364 | * @see | |
| 365 | * Extensions.CredentialProtection.CredentialProtectionInput#require(Extensions.CredentialProtection.CredentialProtectionPolicy) | |
| 366 | * @see <a | |
| 367 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-credProtect-extension">CTAP2 | |
| 368 | * §12.1. Credential Protection (credProtect)</a> | |
| 369 | */ | |
| 370 | public RegistrationExtensionInputsBuilder credProtect( | |
| 371 | Extensions.CredentialProtection.CredentialProtectionInput credProtect) { | |
| 372 | this.credProtect = credProtect; | |
| 373 |
1
1. credProtect : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs$RegistrationExtensionInputsBuilder::credProtect → KILLED |
return this; |
| 374 | } | |
| 375 | ||
| 376 | /** | |
| 377 | * Enable the Large blob storage extension (<code>largeBlob</code>). | |
| 378 | * | |
| 379 | * <p>Alias of <code>largeBlob(new Extensions.LargeBlob.LargeBlobRegistrationInput(support)) | |
| 380 | * </code>. | |
| 381 | * | |
| 382 | * @param support an {@link Extensions.LargeBlob.LargeBlobRegistrationInput.LargeBlobSupport} | |
| 383 | * value to set as the <code>support</code> attribute of the <code>largeBlob</code> | |
| 384 | * extension input. | |
| 385 | * @see #largeBlob(Extensions.LargeBlob.LargeBlobRegistrationInput) | |
| 386 | * @see <a | |
| 387 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-large-blob-extension">§10.5. | |
| 388 | * Large blob storage extension (largeBlob)</a> | |
| 389 | */ | |
| 390 | public RegistrationExtensionInputsBuilder largeBlob( | |
| 391 | Extensions.LargeBlob.LargeBlobRegistrationInput.LargeBlobSupport support) { | |
| 392 | this.largeBlob = new Extensions.LargeBlob.LargeBlobRegistrationInput(support); | |
| 393 |
1
1. largeBlob : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs$RegistrationExtensionInputsBuilder::largeBlob → KILLED |
return this; |
| 394 | } | |
| 395 | ||
| 396 | /** | |
| 397 | * Enable the Large blob storage extension (<code>largeBlob</code>). | |
| 398 | * | |
| 399 | * @see #largeBlob(Extensions.LargeBlob.LargeBlobRegistrationInput.LargeBlobSupport) | |
| 400 | * @see <a | |
| 401 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-large-blob-extension">§10.5. | |
| 402 | * Large blob storage extension (largeBlob)</a> | |
| 403 | */ | |
| 404 | public RegistrationExtensionInputsBuilder largeBlob( | |
| 405 | Extensions.LargeBlob.LargeBlobRegistrationInput largeBlob) { | |
| 406 | this.largeBlob = largeBlob; | |
| 407 |
1
1. largeBlob : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs$RegistrationExtensionInputsBuilder::largeBlob → KILLED |
return this; |
| 408 | } | |
| 409 | ||
| 410 | /** | |
| 411 | * Enable the Pseudo-random function extension (<code>prf</code>). | |
| 412 | * | |
| 413 | * <p>This extension allows a Relying Party to evaluate outputs from a pseudo-random function | |
| 414 | * (PRF) associated with a credential. | |
| 415 | * | |
| 416 | * <p>Use the {@link com.yubico.webauthn.data.Extensions.Prf.PrfRegistrationInput} factory | |
| 417 | * functions to construct the argument: | |
| 418 | * | |
| 419 | * <ul> | |
| 420 | * <li>Use {@link Extensions.Prf.PrfRegistrationInput#enable()} to request that the credential | |
| 421 | * be capable of PRF evaluation, but without evaluating the PRF at this time. | |
| 422 | * <li>Use {@link Extensions.Prf.PrfRegistrationInput#eval(Extensions.Prf.PrfValues)} to | |
| 423 | * request that the credential be capable of PRF evaluation and immediately evaluate it | |
| 424 | * for the given inputs. Note that not all authenticators support this, in which case a | |
| 425 | * follow-up authentication ceremony may be needed in order to evaluate the PRF. | |
| 426 | * </ul> | |
| 427 | * | |
| 428 | * @since 2.7.0 | |
| 429 | * @see Extensions.Prf.PrfRegistrationInput#enable() | |
| 430 | * @see Extensions.Prf.PrfRegistrationInput#eval(Extensions.Prf.PrfValues) | |
| 431 | * @see <a href="https://www.w3.org/TR/2025/WD-webauthn-3-20250127/#prf-extension">§10.1.4. | |
| 432 | * Pseudo-random function extension (prf)</a> | |
| 433 | */ | |
| 434 | public RegistrationExtensionInputsBuilder prf(Extensions.Prf.PrfRegistrationInput prf) { | |
| 435 | this.prf = prf; | |
| 436 |
1
1. prf : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs$RegistrationExtensionInputsBuilder::prf → KILLED |
return this; |
| 437 | } | |
| 438 | ||
| 439 | /** | |
| 440 | * Enable the User Verification Method Extension (<code>uvm</code>). | |
| 441 | * | |
| 442 | * @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-uvm-extension">§10.3. | |
| 443 | * User Verification Method Extension (uvm)</a> | |
| 444 | */ | |
| 445 | public RegistrationExtensionInputsBuilder uvm() { | |
| 446 | this.uvm = true; | |
| 447 |
1
1. uvm : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs$RegistrationExtensionInputsBuilder::uvm → KILLED |
return this; |
| 448 | } | |
| 449 | ||
| 450 | /** For compatibility with {@link Builder}(toBuilder = true) */ | |
| 451 | private RegistrationExtensionInputsBuilder uvm(Boolean uvm) { | |
| 452 | this.uvm = uvm; | |
| 453 |
1
1. uvm : replaced return value with null for com/yubico/webauthn/data/RegistrationExtensionInputs$RegistrationExtensionInputsBuilder::uvm → KILLED |
return this; |
| 454 | } | |
| 455 | } | |
| 456 | } | |
Mutations | ||
| 95 |
1.1 2.2 3.3 |
|
| 113 |
1.1 |
|
| 114 |
1.1 |
|
| 115 |
1.1 |
|
| 116 |
1.1 |
|
| 117 |
1.1 |
|
| 118 |
1.1 |
|
| 119 |
1.1 |
|
| 131 |
1.1 |
|
| 143 |
1.1 2.2 3.3 |
|
| 149 |
1.1 2.2 3.3 |
|
| 163 |
1.1 |
|
| 173 |
1.1 |
|
| 185 |
1.1 |
|
| 203 |
1.1 |
|
| 219 |
1.1 |
|
| 230 |
1.1 2.2 3.3 |
|
| 236 |
1.1 2.2 3.3 |
|
| 247 |
1.1 |
|
| 250 |
1.1 |
|
| 253 |
1.1 |
|
| 256 |
1.1 |
|
| 259 |
1.1 |
|
| 262 |
1.1 |
|
| 265 |
1.1 |
|
| 286 |
1.1 |
|
| 306 |
1.1 |
|
| 318 |
1.1 |
|
| 337 |
1.1 |
|
| 355 |
1.1 |
|
| 373 |
1.1 |
|
| 393 |
1.1 |
|
| 407 |
1.1 |
|
| 436 |
1.1 |
|
| 447 |
1.1 |
|
| 453 |
1.1 |