java.lang.Object
com.webauthn4j.converter.AttestedCredentialDataConverter
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 Summary
ConstructorsConstructorDescriptionAttestedCredentialDataConverter(@NotNull ObjectConverter objectConverter) Constructor for AttestedCredentialDataConverter -
Method Summary
Modifier and TypeMethodDescription@NotNull AttestedCredentialDataconvert(@org.jetbrains.annotations.NotNull byte[] attestedCredentialData) Converts a byte array containing attested credential data to an AttestedCredentialData object.@org.jetbrains.annotations.NotNull byte[]convert(@NotNull AttestedCredentialData attestationData) Converts an AttestedCredentialData object to its byte array representation.@NotNull AttestedCredentialDataconvert(@NotNull ByteBuffer attestedCredentialData) Converts a ByteBuffer containing attested credential data to an AttestedCredentialData object.@org.jetbrains.annotations.NotNull byte[]extractCredentialId(@org.jetbrains.annotations.NotNull byte[] attestedCredentialData) Extract credentialId byte array from a attestedCredentialData byte array.
-
Constructor Details
-
AttestedCredentialDataConverter
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
-