Search in sources :

Example 1 with AttestationObject

use of com.webauthn4j.data.attestation.AttestationObject in project webauthn4j by webauthn4j.

the class RegistrationDataTest method equals_hashCode_test.

@Test
void equals_hashCode_test() {
    AttestationObject attestationObject = mock(AttestationObject.class);
    byte[] attestationObjectBytes = new byte[32];
    CollectedClientData collectedClientData = mock(CollectedClientData.class);
    byte[] collectedClientDataBytes = new byte[128];
    AuthenticationExtensionsClientOutputs<RegistrationExtensionClientOutput> authenticationExtensionsClientOutputs = null;
    Set<AuthenticatorTransport> transports = Collections.emptySet();
    RegistrationData instanceA = new RegistrationData(attestationObject, attestationObjectBytes, collectedClientData, collectedClientDataBytes, authenticationExtensionsClientOutputs, transports);
    RegistrationData instanceB = new RegistrationData(attestationObject, attestationObjectBytes, collectedClientData, collectedClientDataBytes, authenticationExtensionsClientOutputs, transports);
    assertThat(instanceA).isEqualTo(instanceB).hasSameHashCodeAs(instanceB);
}
Also used : CollectedClientData(com.webauthn4j.data.client.CollectedClientData) AttestationObject(com.webauthn4j.data.attestation.AttestationObject) RegistrationExtensionClientOutput(com.webauthn4j.data.extension.client.RegistrationExtensionClientOutput) Test(org.junit.jupiter.api.Test)

Example 2 with AttestationObject

use of com.webauthn4j.data.attestation.AttestationObject in project webauthn4j by webauthn4j.

the class RegistrationDataTest method toString_test.

@Test
void toString_test() {
    AttestationObject attestationObject = mock(AttestationObject.class);
    byte[] attestationObjectBytes = new byte[32];
    CollectedClientData collectedClientData = mock(CollectedClientData.class);
    byte[] collectedClientDataBytes = new byte[128];
    AuthenticationExtensionsClientOutputs<RegistrationExtensionClientOutput> authenticationExtensionsClientOutputs = null;
    Set<AuthenticatorTransport> transports = Collections.emptySet();
    RegistrationData instance = new RegistrationData(attestationObject, attestationObjectBytes, collectedClientData, collectedClientDataBytes, authenticationExtensionsClientOutputs, transports);
    // noinspection ResultOfMethodCallIgnored
    assertThatCode(instance::toString).doesNotThrowAnyException();
}
Also used : CollectedClientData(com.webauthn4j.data.client.CollectedClientData) AttestationObject(com.webauthn4j.data.attestation.AttestationObject) RegistrationExtensionClientOutput(com.webauthn4j.data.extension.client.RegistrationExtensionClientOutput) Test(org.junit.jupiter.api.Test)

Example 3 with AttestationObject

use of com.webauthn4j.data.attestation.AttestationObject in project webauthn4j by webauthn4j.

the class TestDataUtil method createCoreRegistrationObjectWithAppleAppAttestAttestation.

public static CoreRegistrationObject createCoreRegistrationObjectWithAppleAppAttestAttestation() {
    // Key ID: "eTAkPnbDrHW+v17P3CrBvb4gPKLxpSxvsnyVTFXVq+w="
    byte[] collectedClientDataBytes = Base64UrlUtil.decode("eyJvcmlnaW4iOiJodHRwOi8vbG9jYWxob3N0OjgwODAiLCJjaGFsbGVuZ2UiOiJkM1Z5ZW1Wc2NHWnliM0JtIiwidHlwZSI6IndlYmF1dGhuLmNyZWF0ZSJ9");
    byte[] clientDataHash = MessageDigestUtil.createSHA256().digest(collectedClientDataBytes);
    byte[] attestationObjectBytes = Base64UrlUtil.decode("o2NmbXRvYXBwbGUtYXBwYXR0ZXN0Z2F0dFN0bXSiY3g1Y4JZAvYwggLyMIICeaADAgECAgYBc_5ZDswwCgYIKoZIzj0EAwIwTzEjMCEGA1UEAwwaQXBwbGUgQXBwIEF0dGVzdGF0aW9uIENBIDExEzARBgNVBAoMCkFwcGxlIEluYy4xEzARBgNVBAgMCkNhbGlmb3JuaWEwHhcNMjAwODE3MjEyNTE2WhcNMjAwODE4MjEzNTE2WjCBkTFJMEcGA1UEAwxANTQ0ZTk0ODEwNTA5MTNlOThjMzRiYzg5MmM5ZjI1Y2NmMGM4YmQ0NjA3YTdmNjdkZGUzMjE2MDA4ZDk5MTU3YjEaMBgGA1UECwwRQUFBIENlcnRpZmljYXRpb24xEzARBgNVBAoMCkFwcGxlIEluYy4xEzARBgNVBAgMCkNhbGlmb3JuaWEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAR3d82Uh2zHPFbH86C-5P3SNOg37xIM0bRuqoz0uSTkSFboZc99_wFlXW0MZKruzD0UAHWm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ARULsOwE-fuAVuqNO21LciWFuDE07_0KvhByfSa-2wIhAKJnNxm3Eh6hV1DhEH7aHRdWUhtsiRc6AF2ayQkf772BAAAAAAAAaGF1dGhEYXRhWKQ55G_XcFes9vC8TnMMtLn-dO2k9aSdIb2vEJj7jXeszEAAAAAAYXBwYXR0ZXN0ZGV2ZWxvcAAgVE6UgQUJE-mMNLyJLJ8lzPDIvUYHp_Z93jIWAI2ZFXulAQIDJiABIVggd3fNlIdsxzxWx_OgvuT90jToN-8SDNG0bqqM9Lkk5EgiWCBW6GXPff8BZV1tDGSq7sw9FAB1poPSsgZOENL5YSdAkw");
    AttestationObject attestationObject = attestationObjectConverter.convert(attestationObjectBytes);
    Set<AuthenticatorTransport> transports = Collections.emptySet();
    AuthenticationExtensionsClientOutputs<RegistrationExtensionClientOutput> authenticationExtensionsClientOutputs = new AuthenticationExtensionsClientOutputs<>();
    Instant timestamp = Instant.parse("2020-08-18T13:37:00");
    return new CoreRegistrationObject(attestationObject, attestationObjectBytes, clientDataHash, TestDataUtil.createServerProperty(), timestamp);
}
Also used : Instant(java.time.Instant) AttestationObject(com.webauthn4j.data.attestation.AttestationObject) AuthenticationExtensionsClientOutputs(com.webauthn4j.data.extension.client.AuthenticationExtensionsClientOutputs) CoreRegistrationObject(com.webauthn4j.validator.CoreRegistrationObject) RegistrationExtensionClientOutput(com.webauthn4j.data.extension.client.RegistrationExtensionClientOutput)

Example 4 with AttestationObject

use of com.webauthn4j.data.attestation.AttestationObject in project webauthn4j by webauthn4j.

the class TestDataUtil method createRegistrationObjectWithAppleAppAttestAttestation.

public static DCRegistrationObject createRegistrationObjectWithAppleAppAttestAttestation() {
    byte[] keyId = Base64Util.decode("VnfqjSp0rWyyqNhrfh+9/IhLIvXuYTPAmJEVQwl4dko=");
    byte[] attestationObjectBytes = Base64Util.decode("o2NmbXRvYXBwbGUtYXBwYXR0ZXN0Z2F0dFN0bXSiY3g1Y4JZAuQwggLgMIICZqADAgECAgYBdNZm2hAwCgYIK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QGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTAhBZM1at5VmCz0RCN6zfRRtTMA0GCWCGSAFlAwQCAQUAoIGVMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTIwMDkyODIwMjgyMFowKgYJKoZIhvcNAQk0MR0wGzANBglghkgBZQMEAgEFAKEKBggqhkjOPQQDAjAvBgkqhkiG9w0BCQQxIgQgyxRZaHevu9mf1wZLftRoPcHNW4p0ILAjKWeQNRnuH54wCgYIKoZIzj0EAwIERzBFAiEAhOOiqKJXPxbi9vfzFCtQLqrdl1CTytgw/WgyYGzzygcCIG7IIKLbIp//Y9cv2eKQXaWAhOvhWO8wkyKfyGlFsprWAAAAAAAAaGF1dGhEYXRhWKQwYALKBV4GxYilLsaqVIL1No4CrzCHsenTCdBAyvXZWkAAAAAAYXBwYXR0ZXN0AAAAAAAAAAAgVnfqjSp0rWyyqNhrfh+9/IhLIvXuYTPAmJEVQwl4dkqlAQIDJiABIVgglTF3wUNp9YREYMn9dd5VhrLSFxyG3oiyYvqCGMmY/2oiWCCjRjwAiVkpkSv7+Qeu7mdm2azTUqEa8CcqDYsHq0b5nQ==");
    byte[] challenge = "1234567890abcdefgh".getBytes();
    byte[] clientDataHash = MessageDigestUtil.createSHA256().digest(challenge);
    DCServerProperty dcServerProperty = new DCServerProperty("8YE23NZS57.com.kayak.travel", new DefaultChallenge(challenge));
    AttestationObject attestationObject = attestationObjectConverter.convert(attestationObjectBytes);
    Instant timestamp = Instant.parse("2020-08-18T13:37:00Z");
    return new DCRegistrationObject(keyId, attestationObject, attestationObjectBytes, clientDataHash, dcServerProperty, timestamp);
}
Also used : DCServerProperty(com.webauthn4j.appattest.server.DCServerProperty) DefaultChallenge(com.webauthn4j.data.client.challenge.DefaultChallenge) DCRegistrationObject(com.webauthn4j.appattest.validator.DCRegistrationObject) Instant(java.time.Instant) AttestationObject(com.webauthn4j.data.attestation.AttestationObject)

Example 5 with AttestationObject

use of com.webauthn4j.data.attestation.AttestationObject in project webauthn4j by webauthn4j.

the class TestDataUtil method createRegistrationObjectWithAndroidKeyAttestation.

public static RegistrationObject createRegistrationObjectWithAndroidKeyAttestation() {
    byte[] collectedClientDataBytes = Base64UrlUtil.decode("eyJvcmlnaW4iOiJodHRwOi8vbG9jYWxob3N0OjgwODAiLCJjaGFsbGVuZ2UiOiJ2MmgxYzJWeWJtRnRaWFEwYVY5T2JUUm9iakZEZUVrd1NHYzNPSGh6VFdsamFHRnNiR1Z1WjJWUXR1YkVEQzRPU3BHSGViSExMTmVyRmY4IiwidHlwZSI6IndlYmF1dGhuLmNyZWF0ZSJ9");
    CollectedClientData collectedClientData = collectedClientDataConverter.convert(collectedClientDataBytes);
    byte[] attestationObjectBytes = Base64UrlUtil.decode("o2NmbXRrYW5kcm9pZC1rZXlnYXR0U3RtdKNjYWxnJmNzaWdYSDBGAiEAl0EDZokwnDApmVkWnSc24ELfZCI-Fx3s7K6YLM-W-xACIQCHvO-RPrqBSVV8rHYlWvRUt-UXpwRc4NQPBnVZ6k9CGGN4NWOCWQMEMIIDADCCAqegAwIBAgIBATAKBggqhkjOPQQDAjCBzjFFMEMGA1UEAww8RkFLRSBBbmRyb2lkIEtleXN0b3JlIFNvZnR3YXJlIEF0dGVzdGF0aW9uIEludGVybWVkaWF0ZSBGQUtFMTEwLwYJKoZIhvcNAQkBFiJjb25mb3JtYW5jZS10b29sc0BmaWRvYWxsaWFuY2Uub3JnMRYwFAYDVQQKDA1GSURPIEFsbGlhbmNlMQwwCgYDVQQLDANDV0cxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJNWTESMBAGA1UEBwwJV2FrZWZpZWxkMCAXDTcwMDIwMTAwMDAwMFoYDzIwOTkwMTMxMjM1OTU5WjApMScwJQYDVQQDDB5GQUtFIEFuZHJvaWQgS2V5c3RvcmUgS2V5IEZBS0Uw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BGQUtFMTEwLwYJKoZIhvcNAQkBFiJjb25mb3JtYW5jZS10b29sc0BmaWRvYWxsaWFuY2Uub3JnMRYwFAYDVQQKDA1GSURPIEFsbGlhbmNlMQwwCgYDVQQLDANDV0cxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJNWTESMBAGA1UEBwwJV2FrZWZpZWxkMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEq1BhK2JNF7vDtRsESTsFSQuMH4udvPN5st7coHxSode2DdMhddwrft28JtsI1V-G9nG2lNwwTaSiioxOA6b1x6NmMGQwEgYDVR0TAQH_BAgwBgEB_wIBADAOBgNVHQ8BAf8EBAMCAoQwHQYDVR0OBBYEFKPSqizvDYzyJALVHLRgvL9qWyQUMB8GA1UdIwQYMBaAFFKaGzLgVqrNUQ_vX4A3BovykSMdMAoGCCqGSM49BAMCA0cAMEQCIGndnqPxgftCSjmtGgrfudLjM9eG_rlFYFX6PcyZeLnSAiA-0w-m9wa1VukUJCqwZvKHE92SOLyW1xhdBV8yF1SlFmhhdXRoRGF0YVikSZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2NBAAAARlUOS1SqR0CfmpUat2wTATEAIHEiziyGohCFUc_hJJZGdtSu9ThnEb74K6NZC3U-KbwgpQECAyYgASFYICw4xPmHIvquDRz2KUzyyQlZFhZMbi-mc_YylL1o55jPIlggGQI5ESYAOfR8QM6quTQSoyhjZET806A3yOoCUe2AWJE");
    AttestationObject attestationObject = attestationObjectConverter.convert(attestationObjectBytes);
    Set<AuthenticatorTransport> transports = Collections.emptySet();
    AuthenticationExtensionsClientOutputs<RegistrationExtensionClientOutput> authenticationExtensionsClientOutputs = new AuthenticationExtensionsClientOutputs<>();
    return new RegistrationObject(attestationObject, attestationObjectBytes, collectedClientData, collectedClientDataBytes, authenticationExtensionsClientOutputs, transports, TestDataUtil.createServerProperty());
}
Also used : CollectedClientData(com.webauthn4j.data.client.CollectedClientData) AttestationObject(com.webauthn4j.data.attestation.AttestationObject) CoreRegistrationObject(com.webauthn4j.validator.CoreRegistrationObject) DCRegistrationObject(com.webauthn4j.appattest.validator.DCRegistrationObject) RegistrationObject(com.webauthn4j.validator.RegistrationObject) AuthenticationExtensionsClientOutputs(com.webauthn4j.data.extension.client.AuthenticationExtensionsClientOutputs) RegistrationExtensionClientOutput(com.webauthn4j.data.extension.client.RegistrationExtensionClientOutput)

Aggregations

AttestationObject (com.webauthn4j.data.attestation.AttestationObject)73 Test (org.junit.jupiter.api.Test)48 ServerProperty (com.webauthn4j.server.ServerProperty)26 DefaultChallenge (com.webauthn4j.data.client.challenge.DefaultChallenge)24 CollectedClientData (com.webauthn4j.data.client.CollectedClientData)23 Challenge (com.webauthn4j.data.client.challenge.Challenge)20 RegistrationExtensionClientOutput (com.webauthn4j.data.extension.client.RegistrationExtensionClientOutput)20 Authenticator (com.webauthn4j.authenticator.Authenticator)19 AuthenticationExtensionClientOutput (com.webauthn4j.data.extension.client.AuthenticationExtensionClientOutput)19 AuthenticationExtensionsClientOutputs (com.webauthn4j.data.extension.client.AuthenticationExtensionsClientOutputs)14 FIDOU2FAuthenticator (com.webauthn4j.test.authenticator.u2f.FIDOU2FAuthenticator)9 DCRegistrationObject (com.webauthn4j.appattest.validator.DCRegistrationObject)8 CoreRegistrationObject (com.webauthn4j.validator.CoreRegistrationObject)8 RegistrationObject (com.webauthn4j.validator.RegistrationObject)8 AuthenticatorTransport (com.webauthn4j.data.AuthenticatorTransport)7 RegistrationExtensionAuthenticatorOutput (com.webauthn4j.data.extension.authenticator.RegistrationExtensionAuthenticatorOutput)7 Instant (java.time.Instant)7 Test (org.junit.Test)5 DCServerProperty (com.webauthn4j.appattest.server.DCServerProperty)4 AttestationObjectConverter (com.webauthn4j.converter.AttestationObjectConverter)4