public class PerCredentialSignatureCounter extends java.lang.Object implements SignatureCounter
SignatureCounter that maintains a separate signature count for each credential ID.
This is the recommended signature counting style for real-world implementations.
| Constructor and Description |
|---|
PerCredentialSignatureCounter()
Creates a counter that will increment the signature count of a credential by
1
when increment(ByteArray) is called. |
PerCredentialSignatureCounter(int increment)
Creates a counter that will increment the signature count of a credential by the specified amount
when
increment(ByteArray) is called. |
| Modifier and Type | Method and Description |
|---|---|
int |
increment(com.yubico.webauthn.data.ByteArray credentialId)
Increment the signature count associated with the given credential ID.
|
int |
initialize(com.yubico.webauthn.data.ByteArray credentialId)
Initialize the signature count for a given credential ID.
|
public PerCredentialSignatureCounter()
1
when increment(ByteArray) is called.public PerCredentialSignatureCounter(int increment)
increment(ByteArray) is called.increment - the amount that should be added to a signature count when it is incremented.public int increment(com.yubico.webauthn.data.ByteArray credentialId)
SignatureCounterNote: This does not imply that there must be a one-to-one mapping between credential IDs and signature counts.
SignatureCounter.initialize(ByteArray) must have been called for the given credential ID
before invoking this method for the first time.
increment in interface SignatureCountercredentialId - The credential ID that was just used to sign something.public int initialize(com.yubico.webauthn.data.ByteArray credentialId)
SignatureCounterWhat Initialization entails exactly is implementation-defined.
initialize in interface SignatureCountercredentialId - The credential ID.