Class PasskeyVerifier
PasskeyVerifier.Expectation; what the client sent is the JSON text of PublicKeyCredential.toJSON().What is verified. The type of the ceremony; the challenge, byte for byte; the origin, against the exact origins expected; that the credential was not made in a frame of another origin; the hash of the relying party ID; user presence, and user verification when expected; the consistency of the backup flags; the algorithm, against the ones offered; the credential public key (see CoseKey); for an assertion the signature over the authenticator data and the hash of the client data, with the stored public key, the owner of the credential against the user handle the authenticator returned, and the signature counter, which must grow when it is used.
Attestation. The server asks for none, and takes no decision from an attestation: a passkey proves the user, not the make of the authenticator. The format none must have an empty statement; the format packed is verified - a self attestation against the credential key, a certified one against the key of its first certificate, whose chain is NOT validated (the server keeps no trust anchors); any other format is accepted without evaluation, and its name is recorded.
Every refusal is a PasskeyException whose message is for the server log.
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA verified assertion: what the credential record is updated with.static final classThe assertion a client sent, decoded and not yet verified: what is needed to find the credential it names.static final classWhat the server expects of a ceremony.static final classA verified registration: the new credential.Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe longest JSON text of a client that is read, in characters.Method Summary
Modifier and TypeMethodDescriptionparseAssertion(String responseJSON) Decodes the assertion a client sent, without verifying it: the credential it names is needed to find the public key it is verified with.static PasskeyVerifier.AssertionverifyAssertion(PasskeyVerifier.Expectation expected, PasskeyVerifier.AssertionResponse response, CoseKey publicKey, long signCount, boolean backupEligible, byte[] userHandle, boolean discoverable) Verifies an assertion against the credential it names.static PasskeyVerifier.RegistrationverifyRegistration(PasskeyVerifier.Expectation expected, String responseJSON) Verifies a registration.
Field Details
MAX_RESPONSE_LENGTH
public static final int MAX_RESPONSE_LENGTHThe longest JSON text of a client that is read, in characters.- See Also:
Method Details
verifyRegistration
public static PasskeyVerifier.Registration verifyRegistration(PasskeyVerifier.Expectation expected, String responseJSON) throws PasskeyException Verifies a registration.- Parameters:
expected- What the server expects.responseJSON- The JSON text of the client'sRegistrationResponseJSON.- Returns:
- The new credential.
- Throws:
NullPointerException- If a parameter is null.PasskeyException- If the registration is refused; the message says why.
parseAssertion
public static PasskeyVerifier.AssertionResponse parseAssertion(String responseJSON) throws PasskeyException Decodes the assertion a client sent, without verifying it: the credential it names is needed to find the public key it is verified with.- Parameters:
responseJSON- The JSON text of the client'sAuthenticationResponseJSON.- Returns:
- The decoded response.
- Throws:
NullPointerException- IfresponseJSONis null.PasskeyException- If the text is not a well-formed response.
verifyAssertion
public static PasskeyVerifier.Assertion verifyAssertion(PasskeyVerifier.Expectation expected, PasskeyVerifier.AssertionResponse response, CoseKey publicKey, long signCount, boolean backupEligible, byte[] userHandle, boolean discoverable) throws PasskeyException Verifies an assertion against the credential it names.- Parameters:
expected- What the server expects.response- The decoded response.publicKey- The stored public key of the credential.signCount- The stored signature counter of the credential.backupEligible- The stored backup eligibility of the credential.userHandle- The user handle of the user who owns the credential.discoverable-truewhen the request named no credential: the authenticator must then return the user handle.- Returns:
- The verified assertion.
- Throws:
NullPointerException- If a parameter is null.PasskeyException- If the assertion is refused; the message says why.