Class AttestedCredentialDataConverter

java.lang.Object
com.webauthn4j.converter.AttestedCredentialDataConverter

public class AttestedCredentialDataConverter extends Object
A converter class that handles conversion operations for WebAuthn Attested Credential Data. This class provides functionality to convert between AttestedCredentialData objects and their byte array representations, as well as extracting credential IDs from attested credential data. The class uses CBOR (Concise Binary Object Representation) for data serialization and handles the WebAuthn attestation data format which includes AAGUID, credential ID, and credential public key.
See Also:
  • Constructor Details

    • AttestedCredentialDataConverter

      public AttestedCredentialDataConverter(@NotNull @NotNull ObjectConverter objectConverter)
      Constructor for AttestedCredentialDataConverter
      Parameters:
      objectConverter - the object converter to use for CBOR serialization/deserialization
      Throws:
      IllegalArgumentException - if objectConverter is null
  • Method Details

    • convert

      @NotNull public @org.jetbrains.annotations.NotNull byte[] convert(@NotNull @NotNull AttestedCredentialData attestationData)
      Converts an AttestedCredentialData object to its byte array representation.
      Parameters:
      attestationData - the AttestedCredentialData to convert
      Returns:
      byte array representation of the attestation data
    • convert

      @NotNull public @NotNull AttestedCredentialData convert(@NotNull @NotNull ByteBuffer attestedCredentialData)
      Converts a ByteBuffer containing attested credential data to an AttestedCredentialData object.
      Parameters:
      attestedCredentialData - ByteBuffer containing the credential data
      Returns:
      converted AttestedCredentialData object
    • convert

      @NotNull public @NotNull AttestedCredentialData convert(@NotNull @org.jetbrains.annotations.NotNull byte[] attestedCredentialData)
      Converts a byte array containing attested credential data to an AttestedCredentialData object.
      Parameters:
      attestedCredentialData - byte array containing the credential data
      Returns:
      converted AttestedCredentialData object
    • extractCredentialId

      @NotNull public @org.jetbrains.annotations.NotNull byte[] extractCredentialId(@NotNull @org.jetbrains.annotations.NotNull byte[] attestedCredentialData)
      Extract credentialId byte array from a attestedCredentialData byte array.
      Parameters:
      attestedCredentialData - the attestedCredentialData byte array
      Returns:
      the extracted credentialId byte array