Search in sources :

Example 6 with AuthenticatorDataConverter

use of com.webauthn4j.converter.AuthenticatorDataConverter in project webauthn4j-spring-security by webauthn4j.

the class WebAuthnAuthenticationRequestTest method equals_hashCode_test.

@Test
public void equals_hashCode_test() {
    byte[] clientDataJSON = TestDataUtil.createClientDataJSON(ClientDataType.WEBAUTHN_GET);
    byte[] authenticatorData = new AuthenticatorDataConverter(objectConverter).convert(TestDataUtil.createAuthenticatorData());
    WebAuthnAuthenticationRequest requestA = new WebAuthnAuthenticationRequest(new byte[] { 0x01, 0x23 }, clientDataJSON, authenticatorData, new byte[] { 0x45, 0x56 }, "");
    WebAuthnAuthenticationRequest requestB = new WebAuthnAuthenticationRequest(new byte[] { 0x01, 0x23 }, clientDataJSON, authenticatorData, new byte[] { 0x45, 0x56 }, "");
    assertThat(requestA).isEqualTo(requestB).hasSameHashCodeAs(requestB);
}
Also used : AuthenticatorDataConverter(com.webauthn4j.converter.AuthenticatorDataConverter) Test(org.junit.Test)

Aggregations

AuthenticatorDataConverter (com.webauthn4j.converter.AuthenticatorDataConverter)6 CollectedClientDataConverter (com.webauthn4j.converter.CollectedClientDataConverter)3 CollectedClientData (com.webauthn4j.data.client.CollectedClientData)3 AuthenticationExtensionsClientOutputs (com.webauthn4j.data.extension.client.AuthenticationExtensionsClientOutputs)3 ServerProperty (com.webauthn4j.server.ServerProperty)3 Test (org.junit.jupiter.api.Test)3 Authenticator (com.webauthn4j.authenticator.Authenticator)2 AuthenticationExtensionAuthenticatorOutput (com.webauthn4j.data.extension.authenticator.AuthenticationExtensionAuthenticatorOutput)2 AuthenticationExtensionClientOutput (com.webauthn4j.data.extension.client.AuthenticationExtensionClientOutput)2 Test (org.junit.Test)2 AttestationObjectConverter (com.webauthn4j.converter.AttestationObjectConverter)1 AuthenticatorTransport (com.webauthn4j.data.AuthenticatorTransport)1 AttestationObject (com.webauthn4j.data.attestation.AttestationObject)1 RegistrationExtensionAuthenticatorOutput (com.webauthn4j.data.extension.authenticator.RegistrationExtensionAuthenticatorOutput)1 RegistrationExtensionClientOutput (com.webauthn4j.data.extension.client.RegistrationExtensionClientOutput)1 Instant (java.time.Instant)1