Search in sources :

Example 21 with RegistrationObject

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));
}
Also used : AndroidKeyAttestationStatement(com.webauthn4j.data.attestation.statement.AndroidKeyAttestationStatement) AttestationCertificatePath(com.webauthn4j.data.attestation.statement.AttestationCertificatePath) RegistrationObject(com.webauthn4j.validator.RegistrationObject) Test(org.junit.jupiter.api.Test)

Example 22 with 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);
}
Also used : RegistrationObject(com.webauthn4j.validator.RegistrationObject) Test(org.junit.jupiter.api.Test)

Example 23 with 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);
}
Also used : RegistrationObject(com.webauthn4j.validator.RegistrationObject) Test(org.junit.jupiter.api.Test)

Example 24 with 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));
}
Also used : RegistrationObject(com.webauthn4j.validator.RegistrationObject) DCRegistrationObject(com.webauthn4j.appattest.validator.DCRegistrationObject) Test(org.junit.jupiter.api.Test)

Example 25 with 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();
}
Also used : RegistrationObject(com.webauthn4j.validator.RegistrationObject) Test(org.junit.jupiter.api.Test)

Aggregations

RegistrationObject (com.webauthn4j.validator.RegistrationObject)40 Test (org.junit.jupiter.api.Test)31 RegistrationExtensionClientOutput (com.webauthn4j.data.extension.client.RegistrationExtensionClientOutput)9 CoreRegistrationObject (com.webauthn4j.validator.CoreRegistrationObject)9 DCRegistrationObject (com.webauthn4j.appattest.validator.DCRegistrationObject)8 AttestationObject (com.webauthn4j.data.attestation.AttestationObject)8 CollectedClientData (com.webauthn4j.data.client.CollectedClientData)8 AuthenticationExtensionsClientOutputs (com.webauthn4j.data.extension.client.AuthenticationExtensionsClientOutputs)7 AAGUID (com.webauthn4j.data.attestation.authenticator.AAGUID)2 Origin (com.webauthn4j.data.client.Origin)2 Challenge (com.webauthn4j.data.client.challenge.Challenge)2 DefaultChallenge (com.webauthn4j.data.client.challenge.DefaultChallenge)2 ServerProperty (com.webauthn4j.server.ServerProperty)2 DCServerProperty (com.webauthn4j.appattest.server.DCServerProperty)1 AttestationObjectConverter (com.webauthn4j.converter.AttestationObjectConverter)1 CollectedClientDataConverter (com.webauthn4j.converter.CollectedClientDataConverter)1 ObjectConverter (com.webauthn4j.converter.util.ObjectConverter)1 AuthenticatorAttestationType (com.webauthn4j.data.AuthenticatorAttestationType)1 AuthenticatorTransport (com.webauthn4j.data.AuthenticatorTransport)1 AndroidKeyAttestationStatement (com.webauthn4j.data.attestation.statement.AndroidKeyAttestationStatement)1