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]);
}
Aggregations