@@ -57,17 +57,20 @@ public class AssertionExtensionInputs implements ExtensionInputs {
57
57
private final AppId appid ;
58
58
private final Extensions .LargeBlob .LargeBlobAuthenticationInput largeBlob ;
59
59
private final Extensions .Prf .PrfAuthenticationInput prf ;
60
+ private final Extensions .Spc .SpcAuthenticationInput spc ;
60
61
private final Boolean uvm ;
61
62
62
63
@ JsonCreator
63
64
private AssertionExtensionInputs (
64
65
@ JsonProperty ("appid" ) AppId appid ,
65
66
@ JsonProperty ("largeBlob" ) Extensions .LargeBlob .LargeBlobAuthenticationInput largeBlob ,
66
67
@ JsonProperty ("prf" ) Extensions .Prf .PrfAuthenticationInput prf ,
68
+ @ JsonProperty ("spc" ) Extensions .Spc .SpcAuthenticationInput spc ,
67
69
@ JsonProperty ("uvm" ) Boolean uvm ) {
68
70
this .appid = appid ;
69
71
this .largeBlob = largeBlob ;
70
72
this .prf = prf ;
73
+ this .spc = spc ;
71
74
this .uvm = (uvm != null && uvm ) ? true : null ;
72
75
}
73
76
@@ -83,6 +86,7 @@ public AssertionExtensionInputs merge(AssertionExtensionInputs other) {
83
86
this .appid != null ? this .appid : other .appid ,
84
87
this .largeBlob != null ? this .largeBlob : other .largeBlob ,
85
88
this .prf != null ? this .prf : other .prf ,
89
+ this .spc != null ? this .spc : other .spc ,
86
90
this .uvm != null ? this .uvm : other .uvm );
87
91
}
88
92
@@ -103,6 +107,9 @@ public Set<String> getExtensionIds() {
103
107
if (prf != null ) {
104
108
ids .add (Extensions .Prf .EXTENSION_ID );
105
109
}
110
+ if (spc != null ) {
111
+ ids .add (Extensions .Spc .EXTENSION_ID );
112
+ }
106
113
if (getUvm ()) {
107
114
ids .add (Extensions .Uvm .EXTENSION_ID );
108
115
}
@@ -212,6 +219,21 @@ public AssertionExtensionInputsBuilder prf(Extensions.Prf.PrfAuthenticationInput
212
219
return this ;
213
220
}
214
221
222
+ /**
223
+ * Enable the Secure Payment Confirmation extension (<code>spc</code>).
224
+ *
225
+ * <p>This extension indicates that a credential is either being created for or used for Secure
226
+ * Payment Confirmation, respectively.
227
+ *
228
+ * @see <a
229
+ * href="https://www.w3.org/TR/secure-payment-confirmation/#sctn-payment-extension-registration">§5.
230
+ * Secure Payment Confirmation extension (SPC)</a>
231
+ */
232
+ public AssertionExtensionInputsBuilder spc (Extensions .Spc .SpcAuthenticationInput spc ) {
233
+ this .spc = spc ;
234
+ return this ;
235
+ }
236
+
215
237
/**
216
238
* Enable the User Verification Method Extension (<code>uvm</code>).
217
239
*
@@ -299,6 +321,41 @@ private Extensions.Prf.PrfAuthenticationInput getPrfJson() {
299
321
: null ;
300
322
}
301
323
324
+ /**
325
+ * The input to the Secure Payment Confirmation extension (<code>spc</code>), if any.
326
+ *
327
+ * <p>This extension indicates that a credential is either being created for or used for Secure
328
+ * Payment Confirmation, respectively.
329
+ *
330
+ * @since 2.7.0
331
+ * @see Extensions.Prf.PrfAuthenticationInput#eval(Extensions.Prf.PrfValues)
332
+ * @see Extensions.Prf.PrfAuthenticationInput#evalByCredential(Map)
333
+ * @see Extensions.Prf.PrfAuthenticationInput#evalByCredentialWithFallback(Map,
334
+ * Extensions.Prf.PrfValues)
335
+ * @see <a href="https://www.w3.org/TR/2025/WD-webauthn-3-20250127/#prf-extension">§10.1.4.
336
+ * Pseudo-random function extension (prf)</a>
337
+ */
338
+ public Optional <Extensions .Spc .SpcAuthenticationInput > getSpc () {
339
+ return Optional .ofNullable (spc );
340
+ }
341
+
342
+ /** For JSON serialization, to omit false and null values. */
343
+ @ JsonProperty ("spc" )
344
+ private Extensions .Spc .SpcAuthenticationInput getSpcJson () {
345
+ return spc != null
346
+ && (spc .getIsPayment ()
347
+ || spc .getBrowserBoundPubKeyCredParams ().isPresent ()
348
+ || spc .getRpId ().isPresent ()
349
+ || spc .getTopOrigin ().isPresent ()
350
+ || spc .getPayeeName ().isPresent ()
351
+ || spc .getPayeeOrigin ().isPresent ()
352
+ || spc .getPaymentEntitiesLogos ().isPresent ()
353
+ || spc .getTotal ().isPresent ()
354
+ || spc .getInstrument ().isPresent ())
355
+ ? spc
356
+ : null ;
357
+ }
358
+
302
359
/**
303
360
* @return <code>true</code> if the User Verification Method Extension (<code>uvm</code>) is
304
361
* enabled, <code>false</code> otherwise.
0 commit comments