| 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.JsonProperty; | |
| 29 | import lombok.Builder; | |
| 30 | import lombok.NonNull; | |
| 31 | import lombok.Value; | |
| 32 | ||
| 33 | /** | |
| 34 | * Attested credential data is a variable-length byte array added to the authenticator data when | |
| 35 | * generating an attestation object for a given credential. This class provides access to the three | |
| 36 | * data segments of that byte array. | |
| 37 | * | |
| 38 | * @see <a | |
| 39 | * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-attested-credential-data">6.4.1. | |
| 40 | * Attested Credential Data</a> | |
| 41 | */ | |
| 42 | @Value | |
| 43 | @Builder(toBuilder = true) | |
| 44 | public class AttestedCredentialData { | |
| 45 | ||
| 46 | /** The AAGUID of the authenticator. */ | |
| 47 | @NonNull private final ByteArray aaguid; | |
| 48 | ||
| 49 | /** The credential ID of the attested credential. */ | |
| 50 | @NonNull private final ByteArray credentialId; | |
| 51 | ||
| 52 | /** | |
| 53 | * The credential public key encoded in COSE_Key format, as defined in Section 7 of <a | |
| 54 | * href="https://tools.ietf.org/html/rfc8152">RFC 8152</a>. | |
| 55 | */ | |
| 56 | @NonNull private final ByteArray credentialPublicKey; | |
| 57 | ||
| 58 | @JsonCreator | |
| 59 | private AttestedCredentialData( | |
| 60 |
1
1. <init> : negated conditional → KILLED |
@NonNull @JsonProperty("aaguid") ByteArray aaguid, |
| 61 |
1
1. <init> : negated conditional → KILLED |
@NonNull @JsonProperty("credentialId") ByteArray credentialId, |
| 62 |
1
1. <init> : negated conditional → KILLED |
@NonNull @JsonProperty("credentialPublicKey") ByteArray credentialPublicKey) { |
| 63 | this.aaguid = aaguid; | |
| 64 | this.credentialId = credentialId; | |
| 65 | this.credentialPublicKey = credentialPublicKey; | |
| 66 | } | |
| 67 | ||
| 68 | static AttestedCredentialDataBuilder builder() { | |
| 69 |
1
1. builder : replaced return value with null for com/yubico/webauthn/data/AttestedCredentialData::builder → KILLED |
return new AttestedCredentialDataBuilder(); |
| 70 | } | |
| 71 | ||
| 72 | static class AttestedCredentialDataBuilder {} | |
| 73 | } | |
Mutations | ||
| 60 |
1.1 |
|
| 61 |
1.1 |
|
| 62 |
1.1 |
|
| 69 |
1.1 |