Record Class Passkey
java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.domain.passkeys.Passkey
- Record Components:
id- credential identifier, as the unpadded base64url text Spring Security stores.userId- WebAuthn user handle of the owner, as the unpadded base64url text Spring Security stores.label- name the user gave to the passkey.createdAt- instant at which the passkey was registered.lastUsedAt- instant of the last sign-in with it, ornullwhen it has never been used.signatureCount- signature counter reported by the authenticator at its last use.backupEligible- whether the authenticator allows the credential to be backed up (synced).backedUp- whether the credential is currently backed up.
public record Passkey(String id, String userId, String label, Instant createdAt, Instant lastUsedAt, long signatureCount, boolean backupEligible, boolean backedUp)
extends Record
A passkey (WebAuthn credential) registered by a user. Only the data a user manages is modelled; the public key and
attestation stay in the framework's store.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for thebackedUprecord component.private final booleanThe field for thebackupEligiblerecord component.private final InstantThe field for thecreatedAtrecord component.private final StringThe field for theidrecord component.private final StringThe field for thelabelrecord component.private final InstantThe field for thelastUsedAtrecord component.private final longThe field for thesignatureCountrecord component.private final StringThe field for theuserIdrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbackedUp()Returns the value of thebackedUprecord component.booleanReturns the value of thebackupEligiblerecord component.Returns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.label()Returns the value of thelabelrecord component.Returns the value of thelastUsedAtrecord component.longReturns the value of thesignatureCountrecord component.final StringtoString()Returns a string representation of this record class.userId()Returns the value of theuserIdrecord component.
-
Field Details
-
id
The field for theidrecord component. -
userId
The field for theuserIdrecord component. -
label
The field for thelabelrecord component. -
createdAt
The field for thecreatedAtrecord component. -
lastUsedAt
The field for thelastUsedAtrecord component. -
signatureCount
private final long signatureCountThe field for thesignatureCountrecord component. -
backupEligible
private final boolean backupEligibleThe field for thebackupEligiblerecord component. -
backedUp
private final boolean backedUpThe field for thebackedUprecord component.
-
-
Constructor Details
-
Passkey
public Passkey(String id, String userId, String label, Instant createdAt, Instant lastUsedAt, long signatureCount, boolean backupEligible, boolean backedUp) Validates the passkey.- Throws:
IllegalArgumentException- if the id, owner or label is blank, the creation instant is missing, or the signature counter is negative.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
userId
Returns the value of theuserIdrecord component.- Returns:
- the value of the
userIdrecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-
lastUsedAt
Returns the value of thelastUsedAtrecord component.- Returns:
- the value of the
lastUsedAtrecord component
-
signatureCount
public long signatureCount()Returns the value of thesignatureCountrecord component.- Returns:
- the value of the
signatureCountrecord component
-
backupEligible
public boolean backupEligible()Returns the value of thebackupEligiblerecord component.- Returns:
- the value of the
backupEligiblerecord component
-
backedUp
public boolean backedUp()Returns the value of thebackedUprecord component.- Returns:
- the value of the
backedUprecord component
-