Package org.springframework.security.web.webauthn.api

# Class PublicKeyCredential<R extends AuthenticatorResponse>

java.lang.Object
org.springframework.security.web.webauthn.api.PublicKeyCredential<R>

All Implemented Interfaces:
  `Serializable`

public final class PublicKeyCredential<R extends AuthenticatorResponse> extends Object implements Serializable
PublicKeyCredential contains the attributes that are returned to the caller when a new credential is created, or a new assertion is requested.

Since:
  6.4
See Also:
  - Serialized Form

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static final class`
`PublicKeyCredential.PublicKeyCredentialBuilder<R extends AuthenticatorResponse>`
The `PublicKeyCredential.PublicKeyCredentialBuilder`

## Method Summary

Modifier and Type
Method
Description
`static <T extends AuthenticatorResponse>
PublicKeyCredential.PublicKeyCredentialBuilder<T>`
`builder()`
Creates a new `PublicKeyCredential.PublicKeyCredentialBuilder`
`AuthenticatorAttachment`
`getAuthenticatorAttachment()`
The authenticatorAttachment reports the authenticator attachment modality in effect at the time the navigator.credentials.create() or navigator.credentials.get() methods successfully complete.
`AuthenticationExtensionsClientOutputs`
`getClientExtensionResults()`
The clientExtensionsResults is a mapping of extension identifier to client extension output.
`String`
`getId()`
The id attribute is inherited from Credential, though PublicKeyCredential overrides Credential's getter, instead returning the base64url encoding of the data contained in the object's [[identifier]] internal slot.
`Bytes`
`getRawId()`
The rawId returns the raw identifier.
`R`
`getResponse()`
The response to the client's request to either create a public key credential, or generate an authentication assertion.
`PublicKeyCredentialType`
`getType()`
The type attribute returns the value of the object's interface object's [[type]] slot, which specifies the credential type represented by this object.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### getId

public String getId()
The id attribute is inherited from Credential, though PublicKeyCredential overrides Credential's getter, instead returning the base64url encoding of the data contained in the object's [[identifier]] internal slot.

### getType

public PublicKeyCredentialType getType()
The type attribute returns the value of the object's interface object's [[type]] slot, which specifies the credential type represented by this object.

Returns:
  the credential type

### getRawId

public Bytes getRawId()
The rawId returns the raw identifier.

Returns:
  the raw id

### getResponse

public R getResponse()
The response to the client's request to either create a public key credential, or generate an authentication assertion.

Returns:
  the response

### getAuthenticatorAttachment

public AuthenticatorAttachment getAuthenticatorAttachment()
The authenticatorAttachment reports the authenticator attachment modality in effect at the time the navigator.credentials.create() or navigator.credentials.get() methods successfully complete.

Returns:
  the authenticator attachment

### getClientExtensionResults

public AuthenticationExtensionsClientOutputs getClientExtensionResults()
The clientExtensionsResults is a mapping of extension identifier to client extension output.

Returns:
  the extension results

### builder

public static <T extends AuthenticatorResponse> PublicKeyCredential.PublicKeyCredentialBuilder<T> builder()
Creates a new `PublicKeyCredential.PublicKeyCredentialBuilder`

Type Parameters:
  `T` - the response type
Returns:
  the `PublicKeyCredential.PublicKeyCredentialBuilder`