RegistrationDataValidator { void validateUVUPFlags(AuthenticatorData<RegistrationExtensionAuthenticatorOutput> authenticatorData, boolean isUserVerificationRequired, boolean isUserPresenceRequired) { if (isUserVerificationRequired && !authenticatorData.isFlagUV()) { throw new UserNotVerifiedException("Validator is configured to check user verified, but UV flag in authenticatorData is not set."); } if (isUserPresenceRequired && !authenticatorData.isFlagUP()) { throw new UserNotPresentException("Validator is configured to check user present, but UP flag in authenticatorData is not set."); } } RegistrationDataValidator(
            List<AttestationStatementValidator> attestationStatementValidators,
            CertPathTrustworthinessValidator certPathTrustworthinessValidator,
            SelfAttestationTrustworthinessValidator selfAttestationTrustworthinessValidator,
            List<CustomRegistrationValidator> customRegistrationValidators,
            ObjectConverter objectConverter); @SuppressWarnings("deprecation") void validate(RegistrationData registrationData, RegistrationParameters registrationParameters); List<CustomRegistrationValidator> getCustomRegistrationValidators();  }
@Test void validateUVUPFlags_not_required_test() { AuthenticatorData<RegistrationExtensionAuthenticatorOutput> authenticatorData = new AuthenticatorData<>(null, (byte) 0, 0); target.validateUVUPFlags(authenticatorData, false, false); }
@Test void validateUVUPFlags_required_test() { AuthenticatorData<RegistrationExtensionAuthenticatorOutput> authenticatorData = new AuthenticatorData<>(null, (byte) (AuthenticatorData.BIT_UP | AuthenticatorData.BIT_UV), 0); target.validateUVUPFlags(authenticatorData, true, true); }
@Test void validateUVUPFlags_UserNotVerifiedException_test() { AuthenticatorData<RegistrationExtensionAuthenticatorOutput> authenticatorData = new AuthenticatorData<>(null, (byte) 0, 0); assertThrows(UserNotVerifiedException.class, () -> target.validateUVUPFlags(authenticatorData, true, false) ); }
@Test void validateUVUPFlags_UserNotPresentException_test() { AuthenticatorData<RegistrationExtensionAuthenticatorOutput> authenticatorData = new AuthenticatorData<>(null, (byte) 0, 0); assertThrows(UserNotPresentException.class, () -> target.validateUVUPFlags(authenticatorData, false, true) ); }