@Test void apk_key_hash_sha256_test_with_not_equal_origins_apk_key_hash_sha1() { Origin originA = new Origin("android:apk-key-hash-sha256:aNiP5iKyQ8JwgGOaKA1zGPUPJIS-0H1xKCQcfIoGLck"); Origin originB = new Origin("android:apk-key-hash:pNiP5iKyQ8JwgGOaKA1zGPUPJIS-0H1xKCQcfIoGLck"); CollectedClientData collectedClientData = new CollectedClientData(ClientDataType.CREATE, TestDataUtil.createChallenge(), originA, null); ServerProperty serverProperty = new ServerProperty(originB, "example.com", TestDataUtil.createChallenge(), null); assertThrows(BadOriginException.class, () -> target.validate(collectedClientData, serverProperty) ); }
public void validate(CollectedClientData collectedClientData, ServerProperty serverProperty) { final Origin clientOrigin = collectedClientData.getOrigin(); if (!serverProperty.getOrigins().contains(clientOrigin)) { throw new BadOriginException("The collectedClientData '" + clientOrigin + "' origin doesn't match any of the preconfigured server origin."); } }
OriginValidator { public void validate(CollectedClientData collectedClientData, ServerProperty serverProperty) { final Origin clientOrigin = collectedClientData.getOrigin(); if (!serverProperty.getOrigins().contains(clientOrigin)) { throw new BadOriginException("The collectedClientData '" + clientOrigin + "' origin doesn't match any of the preconfigured server origin."); } } }
OriginValidator { public void validate(CollectedClientData collectedClientData, ServerProperty serverProperty) { final Origin clientOrigin = collectedClientData.getOrigin(); if (!serverProperty.getOrigins().contains(clientOrigin)) { throw new BadOriginException("The collectedClientData '" + clientOrigin + "' origin doesn't match any of the preconfigured server origin."); } }  }
OriginValidator { public void validate(CollectedClientData collectedClientData, ServerProperty serverProperty) { final Origin clientOrigin = collectedClientData.getOrigin(); if (!serverProperty.getOrigins().contains(clientOrigin)) { throw new BadOriginException("The collectedClientData '" + clientOrigin + "' origin doesn't match any of the preconfigured server origin."); } }  void validate(CollectedClientData collectedClientData, ServerProperty serverProperty); }
OriginValidator { public void validate(CollectedClientData collectedClientData, ServerProperty serverProperty) { final Origin clientOrigin = collectedClientData.getOrigin(); if (!serverProperty.getOrigins().contains(clientOrigin)) { throw new BadOriginException("The collectedClientData '" + clientOrigin + "' origin doesn't match any of the preconfigured server origin."); } }  void validate(CollectedClientData collectedClientData, ServerProperty serverProperty);  }