@Test void extractSignCount_test() { String input = "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2NBAAAARlUOS1SqR0CfmpUat2wTATEAIHEiziyGohCFUc_hJJZGdtSu9ThnEb74K6NZC3U-KbwgpQECAyYgASFYICw4xPmHIvquDRz2KUzyyQlZFhZMbi-mc_YylL1o55jPIlggGQI5ESYAOfR8QM6quTQSoyhjZET806A3yOoCUe2AWJE"; long signCount = new AuthenticatorDataConverter(objectConverter).extractSignCount(Base64UrlUtil.decode(input)); assertThat(signCount).isEqualTo(70); }
public long extractSignCount(byte[] authenticatorData) { byte[] counterBytes = Arrays.copyOfRange(authenticatorData, COUNTER_INDEX, COUNTER_INDEX + COUNTER_LENGTH); return UnsignedNumberUtil.getUnsignedInt(counterBytes); }
AuthenticatorDataConverter { public long extractSignCount(byte[] authenticatorData) { byte[] counterBytes = Arrays.copyOfRange(authenticatorData, COUNTER_INDEX, COUNTER_INDEX + COUNTER_LENGTH); return UnsignedNumberUtil.getUnsignedInt(counterBytes); } }
AuthenticatorDataConverter { public long extractSignCount(byte[] authenticatorData) { byte[] counterBytes = Arrays.copyOfRange(authenticatorData, COUNTER_INDEX, COUNTER_INDEX + COUNTER_LENGTH); return UnsignedNumberUtil.getUnsignedInt(counterBytes); } AuthenticatorDataConverter(ObjectConverter objectConverter); }
AuthenticatorDataConverter { public long extractSignCount(byte[] authenticatorData) { byte[] counterBytes = Arrays.copyOfRange(authenticatorData, COUNTER_INDEX, COUNTER_INDEX + COUNTER_LENGTH); return UnsignedNumberUtil.getUnsignedInt(counterBytes); } AuthenticatorDataConverter(ObjectConverter objectConverter); byte[] convert(AuthenticatorData<T> source); AuthenticatorData<T> convert(byte[] source); byte[] extractAttestedCredentialData(byte[] authenticatorData); long extractSignCount(byte[] authenticatorData); }
AuthenticatorDataConverter { public long extractSignCount(byte[] authenticatorData) { byte[] counterBytes = Arrays.copyOfRange(authenticatorData, COUNTER_INDEX, COUNTER_INDEX + COUNTER_LENGTH); return UnsignedNumberUtil.getUnsignedInt(counterBytes); } AuthenticatorDataConverter(ObjectConverter objectConverter); byte[] convert(AuthenticatorData<T> source); AuthenticatorData<T> convert(byte[] source); byte[] extractAttestedCredentialData(byte[] authenticatorData); long extractSignCount(byte[] authenticatorData);  }