Search in sources :

Example 1 with DCAssertionRequest

use of com.webauthn4j.appattest.data.DCAssertionRequest in project webauthn4j by webauthn4j.

the class DeviceCheckAssertionManagerTest method parse_DCAssertion_with_signature_null_authenticatorData_null_test.

@Test
void parse_DCAssertion_with_signature_null_authenticatorData_null_test() {
    DeviceCheckAssertionManager deviceCheckAssertionManager = new DeviceCheckAssertionManager();
    AuthenticatorData<RegistrationExtensionAuthenticatorOutput> authenticatorData = TestDataUtil.createAuthenticatorData();
    byte[] keyId = new byte[64];
    byte[] authenticatorDataBytes = authenticatorDataConverter.convert(authenticatorData);
    byte[] assertion = cborConverter.writeValueAsBytes(new DCAssertion(new byte[32], authenticatorDataBytes));
    byte[] clientDataHash = new byte[32];
    DCAssertionData dcAssertionData = deviceCheckAssertionManager.parse(new DCAssertionRequest(keyId, assertion, clientDataHash));
    assertThat(dcAssertionData.getKeyId()).isEqualTo(new byte[64]);
    assertThat(dcAssertionData.getSignature()).isEqualTo(new byte[32]);
    assertThat(dcAssertionData.getAuthenticatorData()).isEqualTo(authenticatorData);
    assertThat(dcAssertionData.getClientDataHash()).isEqualTo(new byte[32]);
}
Also used : DCAssertion(com.webauthn4j.appattest.data.DCAssertion) RegistrationExtensionAuthenticatorOutput(com.webauthn4j.data.extension.authenticator.RegistrationExtensionAuthenticatorOutput) DCAssertionData(com.webauthn4j.appattest.data.DCAssertionData) DCAssertionRequest(com.webauthn4j.appattest.data.DCAssertionRequest) Test(org.junit.jupiter.api.Test)

Aggregations

DCAssertion (com.webauthn4j.appattest.data.DCAssertion)1 DCAssertionData (com.webauthn4j.appattest.data.DCAssertionData)1 DCAssertionRequest (com.webauthn4j.appattest.data.DCAssertionRequest)1 RegistrationExtensionAuthenticatorOutput (com.webauthn4j.data.extension.authenticator.RegistrationExtensionAuthenticatorOutput)1 Test (org.junit.jupiter.api.Test)1