Skip to content

Commit 3d7b1e7

Browse files
committed
Add JavaDocs for PRF extension
1 parent 87ca3e6 commit 3d7b1e7

File tree

5 files changed

+325
-68
lines changed

5 files changed

+325
-68
lines changed

webauthn-server-core/src/main/java/com/yubico/webauthn/data/AssertionExtensionInputs.java

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import com.yubico.webauthn.StartAssertionOptions;
3232
import com.yubico.webauthn.extension.appid.AppId;
3333
import java.util.HashSet;
34+
import java.util.Map;
3435
import java.util.Optional;
3536
import java.util.Set;
3637
import lombok.Builder;
@@ -182,9 +183,28 @@ public AssertionExtensionInputsBuilder largeBlob(
182183
/**
183184
* Enable the Pseudo-random function extension (<code>prf</code>).
184185
*
185-
* @see <a
186-
* href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-large-blob-extension">§10.5.
187-
* Large blob storage extension (largeBlob)</a>
186+
* <p>This extension allows a Relying Party to evaluate outputs from a pseudo-random function
187+
* (PRF) associated with a credential.
188+
*
189+
* <p>Use the {@link com.yubico.webauthn.data.Extensions.Prf.PrfAuthenticationInput} factory
190+
* functions to construct the argument:
191+
*
192+
* <ul>
193+
* <li>Use {@link Extensions.Prf.PrfAuthenticationInput#eval(Extensions.Prf.PrfValues)} to use
194+
* the same PRF input for all credentials.
195+
* <li>Use {@link Extensions.Prf.PrfAuthenticationInput#evalByCredential(Map)} to use
196+
* different PRF inputs for different credentials.
197+
* <li>Use {@link Extensions.Prf.PrfAuthenticationInput#evalByCredentialWithFallback(Map,
198+
* Extensions.Prf.PrfValues)} to use different PRF inputs for different credentials, but
199+
* with a "fallback" input for credentials without their own input.
200+
* </ul>
201+
*
202+
* @see Extensions.Prf.PrfAuthenticationInput#eval(Extensions.Prf.PrfValues)
203+
* @see Extensions.Prf.PrfAuthenticationInput#evalByCredential(Map)
204+
* @see Extensions.Prf.PrfAuthenticationInput#evalByCredentialWithFallback(Map,
205+
* Extensions.Prf.PrfValues)
206+
* @see <a href="https://www.w3.org/TR/2025/WD-webauthn-3-20250127/#prf-extension">§10.1.4.
207+
* Pseudo-random function extension (prf)</a>
188208
*/
189209
public AssertionExtensionInputsBuilder prf(Extensions.Prf.PrfAuthenticationInput prf) {
190210
this.prf = prf;
@@ -253,16 +273,17 @@ private Extensions.LargeBlob.LargeBlobAuthenticationInput getLargeBlobJson() {
253273
}
254274

255275
/**
256-
* The input to the Pseudo-random function extension (<code>prf</code>).
276+
* The input to the Pseudo-random function extension (<code>prf</code>), if any.
257277
*
258278
* <p>This extension allows a Relying Party to evaluate outputs from a pseudo-random function
259279
* (PRF) associated with a credential.
260280
*
261-
* @see Extensions.LargeBlob.LargeBlobAuthenticationInput#read()
262-
* @see Extensions.LargeBlob.LargeBlobAuthenticationInput#write(ByteArray)
263-
* @see <a
264-
* href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-large-blob-extension">§10.5.
265-
* Large blob storage extension (largeBlob)</a>
281+
* @see Extensions.Prf.PrfAuthenticationInput#eval(Extensions.Prf.PrfValues)
282+
* @see Extensions.Prf.PrfAuthenticationInput#evalByCredential(Map)
283+
* @see Extensions.Prf.PrfAuthenticationInput#evalByCredentialWithFallback(Map,
284+
* Extensions.Prf.PrfValues)
285+
* @see <a href="https://www.w3.org/TR/2025/WD-webauthn-3-20250127/#prf-extension">§10.1.4.
286+
* Pseudo-random function extension (prf)</a>
266287
*/
267288
public Optional<Extensions.Prf.PrfAuthenticationInput> getPrf() {
268289
return Optional.ofNullable(prf);

webauthn-server-core/src/main/java/com/yubico/webauthn/data/ClientAssertionExtensionOutputs.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public Optional<Boolean> getAppid() {
112112
* href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-large-blob-extension">Large blob
113113
* storage (<code>largeBlob</code>) extension</a>, if any.
114114
*
115-
* @see com.yubico.webauthn.data.Extensions.LargeBlob.LargeBlobRegistrationOutput
115+
* @see com.yubico.webauthn.data.Extensions.LargeBlob.LargeBlobAuthenticationOutput
116116
* @see <a
117117
* href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-large-blob-extension">§10.5.Large
118118
* blob storage extension (largeBlob)</a>
@@ -123,13 +123,12 @@ public Optional<Extensions.LargeBlob.LargeBlobAuthenticationOutput> getLargeBlob
123123

124124
/**
125125
* The extension output for the <a
126-
* href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-large-blob-extension">Large blob
127-
* storage (<code>largeBlob</code>) extension</a>, if any.
126+
* href="https://www.w3.org/TR/2025/WD-webauthn-3-20250127/#prf-extension">Pseudo-random function
127+
* (<code>prf</code>) extension</a>, if any.
128128
*
129-
* @see com.yubico.webauthn.data.Extensions.Prf.PrfRegistrationOutput
130-
* @see <a
131-
* href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-large-blob-extension">§10.5.Large
132-
* blob storage extension (largeBlob)</a>
129+
* @see com.yubico.webauthn.data.Extensions.Prf.PrfAuthenticationOutput
130+
* @see <a href="https://www.w3.org/TR/2025/WD-webauthn-3-20250127/#prf-extension">§10.1.4.
131+
* Pseudo-random function extension (prf)</a>
133132
*/
134133
public Optional<Extensions.Prf.PrfAuthenticationOutput> getPrf() {
135134
return Optional.ofNullable(prf);

webauthn-server-core/src/main/java/com/yubico/webauthn/data/ClientRegistrationExtensionOutputs.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,13 @@ public Optional<Extensions.LargeBlob.LargeBlobRegistrationOutput> getLargeBlob()
136136
}
137137

138138
/**
139-
* The extension output for the Pseudo-random function (<code>prf</code>), if any.
139+
* The extension output for the <a
140+
* href="https://www.w3.org/TR/2025/WD-webauthn-3-20250127/#prf-extension">Pseudo-random function
141+
* (<code>prf</code>) extension</a>, if any.
140142
*
141143
* @see com.yubico.webauthn.data.Extensions.Prf.PrfRegistrationOutput
142-
* @see <a
143-
* href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-large-blob-extension">§10.5.Large
144-
* blob storage extension (largeBlob)</a>
144+
* @see <a href="https://www.w3.org/TR/2025/WD-webauthn-3-20250127/#prf-extension">§10.1.4.
145+
* Pseudo-random function extension (prf)</a>
145146
*/
146147
public Optional<Extensions.Prf.PrfRegistrationOutput> getPrf() {
147148
return Optional.ofNullable(prf);

0 commit comments

Comments
 (0)