|
24 | 24 |
|
25 | 25 | package com.yubico.webauthn;
|
26 | 26 |
|
| 27 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 28 | +import com.fasterxml.jackson.annotation.JsonProperty; |
27 | 29 | import com.yubico.webauthn.data.AttestedCredentialData;
|
28 | 30 | import com.yubico.webauthn.data.AuthenticatorAssertionResponse;
|
29 | 31 | import com.yubico.webauthn.data.AuthenticatorData;
|
30 | 32 | import com.yubico.webauthn.data.ByteArray;
|
31 | 33 | import com.yubico.webauthn.data.PublicKeyCredentialDescriptor;
|
32 | 34 | import com.yubico.webauthn.data.UserIdentity;
|
33 |
| -import lombok.AccessLevel; |
34 |
| -import lombok.AllArgsConstructor; |
35 | 35 | import lombok.Builder;
|
36 | 36 | import lombok.NonNull;
|
37 | 37 | import lombok.Value;
|
|
46 | 46 | * </p>
|
47 | 47 | */
|
48 | 48 | @Value
|
49 |
| -@AllArgsConstructor(access = AccessLevel.PRIVATE) |
50 | 49 | @Builder(toBuilder = true)
|
51 |
| -public class RegisteredCredential { |
| 50 | +public final class RegisteredCredential { |
52 | 51 |
|
53 | 52 | /**
|
54 | 53 | * The <a href="https://www.w3.org/TR/2019/PR-webauthn-20190117/#credential-id">credential ID</a> of the
|
@@ -103,6 +102,19 @@ public class RegisteredCredential {
|
103 | 102 | @Builder.Default
|
104 | 103 | private final long signatureCount = 0;
|
105 | 104 |
|
| 105 | + @JsonCreator |
| 106 | + private RegisteredCredential( |
| 107 | + @NonNull @JsonProperty("credentialId") ByteArray credentialId, |
| 108 | + @NonNull @JsonProperty("userHandle") ByteArray userHandle, |
| 109 | + @NonNull @JsonProperty("publicKeyCose") ByteArray publicKeyCose, |
| 110 | + @JsonProperty("signatureCount") long signatureCount |
| 111 | + ) { |
| 112 | + this.credentialId = credentialId; |
| 113 | + this.userHandle = userHandle; |
| 114 | + this.publicKeyCose = publicKeyCose; |
| 115 | + this.signatureCount = signatureCount; |
| 116 | + } |
| 117 | + |
106 | 118 | public static RegisteredCredentialBuilder.MandatoryStages builder() {
|
107 | 119 | return new RegisteredCredentialBuilder.MandatoryStages();
|
108 | 120 | }
|
|
0 commit comments