use of com.webauthn4j.appattest.validator.DCRegistrationObject in project webauthn4j by webauthn4j.
the class NullAppleAppAttestAttestationStatementValidatorTest method validate_test.
@Test
void validate_test() {
DCRegistrationObject registrationObject = TestDataUtil.createRegistrationObjectWithAppleAppAttestAttestation();
target.validate(registrationObject);
}
use of com.webauthn4j.appattest.validator.DCRegistrationObject in project webauthn4j by webauthn4j.
the class AppleAppAttestAttestationStatementValidator method validate.
@Override
public AttestationType validate(@NonNull CoreRegistrationObject registrationObject) {
AssertUtil.notNull(registrationObject, "registrationObject must not be null");
if (!(registrationObject instanceof DCRegistrationObject)) {
throw new IllegalArgumentException("registrationObject must be an instance of DCRegistrationObject.");
}
if (!supports(registrationObject)) {
throw new IllegalArgumentException(String.format("Specified format '%s' is not supported by %s.", registrationObject.getAttestationObject().getFormat(), this.getClass().getName()));
}
AppleAppAttestAttestationStatement attestationStatement = (AppleAppAttestAttestationStatement) registrationObject.getAttestationObject().getAttestationStatement();
validateAttestationStatementNotNull(attestationStatement);
validateX5c(attestationStatement);
validateNonce(registrationObject);
validatePublicKey(registrationObject);
return AttestationType.BASIC;
}
Aggregations