use of com.webauthn4j.validator.RegistrationObject in project webauthn4j by webauthn4j.
the class AndroidKeyAttestationStatementValidatorTest method validate_empty_x5c_test2.
@Test
void validate_empty_x5c_test2() {
RegistrationObject registrationObject = mock(RegistrationObject.class, RETURNS_DEEP_STUBS);
when(registrationObject.getAttestationObject().getAttestationStatement()).thenReturn(new AndroidKeyAttestationStatement(COSEAlgorithmIdentifier.ES256, new byte[32], new AttestationCertificatePath()));
assertThrows(BadAttestationStatementException.class, () -> target.validate(registrationObject));
}
use of com.webauthn4j.validator.RegistrationObject in project webauthn4j by webauthn4j.
the class AndroidKeyAttestationStatementValidatorTest method validate_with_teeEnforcedOnly_option_test.
@Test
void validate_with_teeEnforcedOnly_option_test() {
RegistrationObject registrationObject = TestDataUtil.createRegistrationObjectWithAndroidKeyAttestation();
target.setTeeEnforcedOnly(true);
assertThat(target.isTeeEnforcedOnly()).isTrue();
target.validate(registrationObject);
}
use of com.webauthn4j.validator.RegistrationObject in project webauthn4j by webauthn4j.
the class FidoMdsMetadataValidatorTest method test.
@Test
void test() {
RegistrationObject registrationObject = TestDataUtil.createRegistrationObjectWithPackedAttestation();
target.validate(registrationObject);
}
use of com.webauthn4j.validator.RegistrationObject in project webauthn4j by webauthn4j.
the class NullAppleAppAttestAttestationStatementValidatorTest method validate_non_AndroidSafetyNetAttestation_test.
@Test
void validate_non_AndroidSafetyNetAttestation_test() {
RegistrationObject registrationObject = TestDataUtil.createRegistrationObjectWithTPMAttestation();
assertThrows(IllegalArgumentException.class, () -> target.validate(registrationObject));
}
use of com.webauthn4j.validator.RegistrationObject in project webauthn4j by webauthn4j.
the class AppleAnonymousAttestationStatementTest method validate.
@Test
void validate() {
RegistrationObject registrationObject = TestDataUtil.createRegistrationObjectWithAppleAttestation();
AppleAnonymousAttestationStatement instance = (AppleAnonymousAttestationStatement) registrationObject.getAttestationObject().getAttestationStatement();
assertThatCode(instance::validate).doesNotThrowAnyException();
}
Aggregations