Class StoredPasskey
java.lang.Object
com.iizix.server.user.passkey.StoredPasskey
A passkey as the server stores it: one row of
IZS.USER_CREDENTIALS (CC-LOGIN-L8-PASSKEYS). Nothing in it is a secret; the public key verifies, it does not sign.- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringThe AAGUID of the authenticator in its text form.final intThe COSE algorithm of the public key.final StringThe attestation statement format at registration.final booleanThe backup flags: eligible (fixed at registration) and state (as last seen).final booleanThe backup flags: eligible (fixed at registration) and state (as last seen).final longThe registration time and the time of the last use (zero for never), epoch milliseconds.final StringThe key of the row: the SHA-256 hash of the credential ID, base64url.final longThe registration time and the time of the last use (zero for never), epoch milliseconds.final StringThe name the user gave the passkey.final booleanFlag for a passkey that was registered through an account recovery (CC-LOGIN-PASSKEY-SECOND-FACTOR, T1-039): for 24 hours fromcreatedit is no proof of a second factor (PasskeyService.waitsAfterRecovery).final StringThe relying party ID the passkey is scoped to.final longThe signature counter last seen.final StringThe transports reported at registration, comma separated.final longThe user ID of the owner.Constructor Summary
ConstructorsConstructorDescriptionStoredPasskey(byte[] credentialId, long userID, String rpId, int algorithm, byte[] publicKey, long signCount, String aaguid, String transports, boolean backupEligible, boolean backedUp, String attestationFormat, long created, long lastUsed, String nickname) Creates a passkey that was not registered through an account recovery.StoredPasskey(byte[] credentialId, long userID, String rpId, int algorithm, byte[] publicKey, long signCount, String aaguid, String transports, boolean backupEligible, boolean backedUp, String attestationFormat, long created, long lastUsed, String nickname, boolean recovery) Creates a passkey.Method Summary
Field Details
key
The key of the row: the SHA-256 hash of the credential ID, base64url. It is the identifier of the passkey on this server (PasskeyInfo.id).userID
public final long userIDThe user ID of the owner.rpId
The relying party ID the passkey is scoped to.algorithm
public final int algorithmThe COSE algorithm of the public key.signCount
public final long signCountThe signature counter last seen.aaguid
The AAGUID of the authenticator in its text form.transports
The transports reported at registration, comma separated.backupEligible
public final boolean backupEligibleThe backup flags: eligible (fixed at registration) and state (as last seen).backedUp
public final boolean backedUpThe backup flags: eligible (fixed at registration) and state (as last seen).attestationFormat
The attestation statement format at registration.created
public final long createdThe registration time and the time of the last use (zero for never), epoch milliseconds.lastUsed
public final long lastUsedThe registration time and the time of the last use (zero for never), epoch milliseconds.nickname
The name the user gave the passkey.recovery
public final boolean recoveryFlag for a passkey that was registered through an account recovery (CC-LOGIN-PASSKEY-SECOND-FACTOR, T1-039): for 24 hours fromcreatedit is no proof of a second factor (PasskeyService.waitsAfterRecovery).
Constructor Details
StoredPasskey
public StoredPasskey(byte[] credentialId, long userID, String rpId, int algorithm, byte[] publicKey, long signCount, String aaguid, String transports, boolean backupEligible, boolean backedUp, String attestationFormat, long created, long lastUsed, String nickname) Creates a passkey that was not registered through an account recovery.- Parameters:
credentialId- The credential ID, 1 to 1023 bytes.userID- The user ID of the owner.rpId- The relying party ID.algorithm- The COSE algorithm of the public key.publicKey- The public key in COSE form.signCount- The signature counter.aaguid- The AAGUID in its text form.transports- The transports, comma separated.backupEligible- Flag for a passkey that may be synchronized.backedUp- Flag for a passkey that is synchronized.attestationFormat- The attestation statement format.created- The registration time, epoch milliseconds.lastUsed- The time of the last use, epoch milliseconds, zero for never.nickname- The name the user gave the passkey.- Throws:
NullPointerException- If a parameter is null.IllegalArgumentException- If the credential ID is empty or longer than 1023 bytes.
StoredPasskey
public StoredPasskey(byte[] credentialId, long userID, String rpId, int algorithm, byte[] publicKey, long signCount, String aaguid, String transports, boolean backupEligible, boolean backedUp, String attestationFormat, long created, long lastUsed, String nickname, boolean recovery) Creates a passkey.- Parameters:
credentialId- The credential ID, 1 to 1023 bytes.userID- The user ID of the owner.rpId- The relying party ID.algorithm- The COSE algorithm of the public key.publicKey- The public key in COSE form.signCount- The signature counter.aaguid- The AAGUID in its text form.transports- The transports, comma separated.backupEligible- Flag for a passkey that may be synchronized.backedUp- Flag for a passkey that is synchronized.attestationFormat- The attestation statement format.created- The registration time, epoch milliseconds.lastUsed- The time of the last use, epoch milliseconds, zero for never.nickname- The name the user gave the passkey.recovery- Flag for a passkey that was registered through an account recovery.- Throws:
NullPointerException- If a parameter is null.IllegalArgumentException- If the credential ID is empty or longer than 1023 bytes.
Method Details
keyOf
Gets the key of a credential ID: its SHA-256 hash, base64url without padding.- Parameters:
credentialId- The credential ID.- Returns:
- The 43 characters.
- Throws:
NullPointerException- IfcredentialIdis null.
getCredentialId
public byte[] getCredentialId()Gets the credential ID.- Returns:
- A copy of the bytes.
getPublicKey
public byte[] getPublicKey()Gets the public key in COSE form.- Returns:
- A copy of the bytes.
toInfo
Gets the passkey as the SignIn module shows it.- Returns:
- The passkey information, without key material.