Search in sources :

Example 1 with PackedAttestationStatement

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

the class NullCertPathTrustworthinessValidatorTest method validate.

@Test
void validate() {
    PackedAttestationStatement attestationStatement = TestAttestationStatementUtil.createBasicPackedAttestationStatement();
    validator.validate(new AAGUID("c4781c71-69d5-48ca-b228-c0ecaa41c75a"), attestationStatement);
}
Also used : PackedAttestationStatement(com.webauthn4j.data.attestation.statement.PackedAttestationStatement) AAGUID(com.webauthn4j.data.attestation.authenticator.AAGUID) Test(org.junit.jupiter.api.Test)

Example 2 with PackedAttestationStatement

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

the class DefaultSelfAttestationTrustworthinessValidatorTest method validate_test.

@Test
void validate_test() {
    DefaultSelfAttestationTrustworthinessValidator validator = new DefaultSelfAttestationTrustworthinessValidator();
    PackedAttestationStatement attestationStatement = TestAttestationStatementUtil.createSelfPackedAttestationStatement(COSEAlgorithmIdentifier.ES256, new byte[32]);
    validator.validate(attestationStatement);
}
Also used : PackedAttestationStatement(com.webauthn4j.data.attestation.statement.PackedAttestationStatement) Test(org.junit.jupiter.api.Test)

Example 3 with PackedAttestationStatement

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

the class DefaultSelfAttestationTrustworthinessValidatorTest method validate_test_with_self_attestation_allowed_false.

@Test
void validate_test_with_self_attestation_allowed_false() {
    DefaultSelfAttestationTrustworthinessValidator validator = new DefaultSelfAttestationTrustworthinessValidator();
    validator.setSelfAttestationAllowed(false);
    PackedAttestationStatement attestationStatement = TestAttestationStatementUtil.createSelfPackedAttestationStatement(COSEAlgorithmIdentifier.ES256, new byte[32]);
    assertThrows(SelfAttestationProhibitedException.class, () -> validator.validate(attestationStatement));
}
Also used : PackedAttestationStatement(com.webauthn4j.data.attestation.statement.PackedAttestationStatement) Test(org.junit.jupiter.api.Test)

Example 4 with PackedAttestationStatement

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

the class NullSelfAttestationTrustworthinessValidatorTest method validate_test.

@Test
void validate_test() {
    PackedAttestationStatement attestationStatement = TestAttestationStatementUtil.createSelfPackedAttestationStatement(COSEAlgorithmIdentifier.ES256, new byte[32]);
    validator.validate(attestationStatement);
}
Also used : PackedAttestationStatement(com.webauthn4j.data.attestation.statement.PackedAttestationStatement) Test(org.junit.jupiter.api.Test)

Example 5 with PackedAttestationStatement

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

the class PackedAttestationStatementValidatorTest method validateAttestationStatementNotNull_test.

@Test
void validateAttestationStatementNotNull_test() {
    PackedAttestationStatement attestationStatement = new PackedAttestationStatement(COSEAlgorithmIdentifier.ES256, new byte[32], new AttestationCertificatePath());
    target.validateAttestationStatementNotNull(attestationStatement);
}
Also used : PackedAttestationStatement(com.webauthn4j.data.attestation.statement.PackedAttestationStatement) AttestationCertificatePath(com.webauthn4j.data.attestation.statement.AttestationCertificatePath) Test(org.junit.jupiter.api.Test)

Aggregations

PackedAttestationStatement (com.webauthn4j.data.attestation.statement.PackedAttestationStatement)10 Test (org.junit.jupiter.api.Test)8 AttestationCertificatePath (com.webauthn4j.data.attestation.statement.AttestationCertificatePath)3 AttestationObject (com.webauthn4j.data.attestation.AttestationObject)1 AAGUID (com.webauthn4j.data.attestation.authenticator.AAGUID)1 COSEAlgorithmIdentifier (com.webauthn4j.data.attestation.statement.COSEAlgorithmIdentifier)1 RegistrationExtensionAuthenticatorOutput (com.webauthn4j.data.extension.authenticator.RegistrationExtensionAuthenticatorOutput)1 X509Certificate (java.security.cert.X509Certificate)1 NonNull (org.checkerframework.checker.nullness.qual.NonNull)1