Class PublicKeyCredential
java.lang.Object
com.codename1.io.webauthn.PublicKeyCredential
The authenticator's response to a passkey ceremony -- either a registration
(type=public-key, response.attestationObject present) or an assertion
(response.signature + response.authenticatorData present).
Immutable. The most common usage is to call toJson() and POST the result
to your relying-party server, which then runs full signature / origin /
counter verification using a server-side library. Do not try to verify the
attestation or assertion on the device -- that is the relying party's
responsibility.
- Since:
- 7.0.245
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCredential type -- always"public-key"for WebAuthn. -
Method Summary
Modifier and TypeMethodDescriptionasMap()Read-only view of the parsed JSON.static PublicKeyCredentialParses a RegistrationResponseJSON / AuthenticationResponseJSON document returned by the native authenticator.response.attestationObjectfor a registration response, base64url-encoded.authenticatorAttachment--"platform"if a built-in authenticator (Face ID / Touch ID, Android biometrics) handled the request,"cross-platform"for a hardware key, ornullif the OS did not report it.response.clientDataJSON, base64url-encoded.getId()id-- the credential identifier, base64url-encoded.getRawId()rawId-- the same identifier as a base64url-encoded byte array.response.signaturefor an assertion response, base64url-encoded.response.userHandlefor an assertion response, base64url-encoded.booleantrueif this is a registration (create) response.toJson()Returns the original JSON.
-
Field Details
-
TYPE_PUBLIC_KEY
Credential type -- always"public-key"for WebAuthn.- See Also:
-
-
Method Details
-
fromJson
Parses a RegistrationResponseJSON / AuthenticationResponseJSON document returned by the native authenticator. -
toJson
Returns the original JSON. POST this back to your relying-party server verbatim. -
asMap
-
getId
id-- the credential identifier, base64url-encoded. Stable across ceremonies for the same authenticator + relying party pair, so this is what you store on the server. -
getRawId
rawId-- the same identifier as a base64url-encoded byte array. -
getAuthenticatorAttachment
authenticatorAttachment--"platform"if a built-in authenticator (Face ID / Touch ID, Android biometrics) handled the request,"cross-platform"for a hardware key, ornullif the OS did not report it. -
isRegistration
public boolean isRegistration()trueif this is a registration (create) response.falsefor an assertion (get) response. -
getClientDataJSON
response.clientDataJSON, base64url-encoded. Decoded server-side and checked against the original challenge / origin. -
getAttestationObject
response.attestationObjectfor a registration response, base64url-encoded.nullon an assertion response. -
getSignature
response.signaturefor an assertion response, base64url-encoded.nullon a registration response. -
getUserHandle
response.userHandlefor an assertion response, base64url-encoded. Matches theuser.idfrom the registration ceremony.
-