@Test void apk_key_hash_sha256_convert_clientDataBase64UrlString() { String clientDataJson = "{\n" + " \"type\": \"webauthn.create\",\n" + " \"challenge\": \"AAABcXKin1fLrZx0o4RL64fs-RUVSxCu\",\n" + " \"origin\": \"android:apk-key-hash-sha256:xT5ZucZJ9N7oq3j3awG8J/NlKf8trfo6AAJB8deuuNo=\",\n" + " \"androidPackageName\": \"com.myrpid.app\"\n" + "}"; String clientDataBase64UrlString = Base64UrlUtil.encodeToString(clientDataJson.getBytes(StandardCharsets.UTF_8)); CollectedClientData collectedClientData = target.convert(clientDataBase64UrlString); assertAll( () -> assertThat(collectedClientData.getType()).isEqualTo(ClientDataType.CREATE), () -> assertThat(collectedClientData.getTokenBinding()).isNull(), () -> assertThat(collectedClientData.getChallenge()).isEqualTo(new DefaultChallenge("AAABcXKin1fLrZx0o4RL64fs-RUVSxCu")), () -> assertThat(collectedClientData.getOrigin()).isEqualTo(new Origin("android:apk-key-hash-sha256:xT5ZucZJ9N7oq3j3awG8J/NlKf8trfo6AAJB8deuuNo=")) ); }
public CollectedClientData convert(String base64UrlString) { if (base64UrlString == null) { return null; } byte[] bytes = Base64UrlUtil.decode(base64UrlString); return convert(bytes); }
CollectedClientDataConverter { public CollectedClientData convert(String base64UrlString) { if (base64UrlString == null) { return null; } byte[] bytes = Base64UrlUtil.decode(base64UrlString); return convert(bytes); } }
CollectedClientDataConverter { public CollectedClientData convert(String base64UrlString) { if (base64UrlString == null) { return null; } byte[] bytes = Base64UrlUtil.decode(base64UrlString); return convert(bytes); } CollectedClientDataConverter(ObjectConverter objectConverter); }
CollectedClientDataConverter { public CollectedClientData convert(String base64UrlString) { if (base64UrlString == null) { return null; } byte[] bytes = Base64UrlUtil.decode(base64UrlString); return convert(bytes); } CollectedClientDataConverter(ObjectConverter objectConverter); CollectedClientData convert(String base64UrlString); CollectedClientData convert(byte[] source); byte[] convertToBytes(CollectedClientData source); String convertToBase64UrlString(CollectedClientData source); }
CollectedClientDataConverter { public CollectedClientData convert(String base64UrlString) { if (base64UrlString == null) { return null; } byte[] bytes = Base64UrlUtil.decode(base64UrlString); return convert(bytes); } CollectedClientDataConverter(ObjectConverter objectConverter); CollectedClientData convert(String base64UrlString); CollectedClientData convert(byte[] source); byte[] convertToBytes(CollectedClientData source); String convertToBase64UrlString(CollectedClientData source);  }