Search in sources :

Example 11 with Response

use of com.webauthn4j.data.attestation.statement.Response in project webauthn4j by webauthn4j.

the class AndroidSafetyNetAttestationStatementValidatorTest method validateNull_with_nonce_null_test.

@Test
void validateNull_with_nonce_null_test() {
    long timestampMs = Instant.now().toEpochMilli();
    String apkPackageName = "com.android.keystore.androidkeystoredemo";
    String[] apkCertificateDigestSha256 = new String[] { "bsb4/WQdaaOWYCd/j9OJiQpg7b0iwFgAc/zzA1tCfwE=" };
    String apkDigestSha256 = "dM/LUHSI9SkQhZHHpQWRnzJ3MvvB2ANSauqYAAbS2Jg=";
    boolean ctsProfileMatch = true;
    boolean basicIntegrity = true;
    String advice = null;
    Response response = new Response(null, timestampMs, apkPackageName, apkCertificateDigestSha256, apkDigestSha256, ctsProfileMatch, basicIntegrity, advice);
    assertThatThrownBy(() -> target.validateResponseNotNull(response)).isInstanceOf(BadAttestationStatementException.class);
}
Also used : Response(com.webauthn4j.data.attestation.statement.Response) Test(org.junit.jupiter.api.Test)

Aggregations

Response (com.webauthn4j.data.attestation.statement.Response)11 Test (org.junit.jupiter.api.Test)9 AndroidSafetyNetAttestationStatement (com.webauthn4j.data.attestation.statement.AndroidSafetyNetAttestationStatement)3 JWSHeader (com.webauthn4j.data.jws.JWSHeader)2 AttestationCertificate (com.webauthn4j.data.attestation.statement.AttestationCertificate)1 JWSFactory (com.webauthn4j.data.jws.JWSFactory)1 BadAttestationStatementException (com.webauthn4j.validator.exception.BadAttestationStatementException)1 CertPath (java.security.cert.CertPath)1 X509Certificate (java.security.cert.X509Certificate)1 ArrayList (java.util.ArrayList)1 NonNull (org.checkerframework.checker.nullness.qual.NonNull)1