# Authenticator.getAttestationObject

Constructs a CBOR-encoded attestation object for testing WebAuthn registration verification. Combines the authenticator data with an attestation statement.

:::warning
This function is mainly for testing purposes. In production, the attestation object is returned by the authenticator during `navigator.credentials.create()`.
:::

## Imports

:::code-group
```ts [Named]
import { Authenticator } from 'ox/webauthn'
```

```ts [Entrypoint]
import * as Authenticator from 'ox/webauthn/Authenticator'
```
:::

## Examples

```ts twoslash
import { P256 } from 'ox'
import { Authenticator } from 'ox/webauthn'

const { publicKey } = P256.createKeyPair()

const attestationObject =
  Authenticator.getAttestationObject({
    authData: Authenticator.getAuthenticatorData({
      rpId: 'example.com',
      flag: 0x41,
      credential: { id: new Uint8Array(32), publicKey }
    })
  })
```

## Definition

```ts
function getAttestationObject(
  options: getAttestationObject.Options,
): Hex.Hex
```

**Source:** [src/webauthn/Authenticator.ts](https://github.com/wevm/ox/blob/main/src/webauthn/Authenticator.ts#L284)

## Parameters

### options

* **Type:** `getAttestationObject.Options`

Options to construct the attestation object.

#### options.attStmt

* **Type:** `Record`
* **Optional**

Attestation statement.

#### options.authData

* **Type:** `0x${string}`

Authenticator data as a Hex string (from `Authenticator.getAuthenticatorData`).

#### options.fmt

* **Type:** `string`
* **Optional**

Attestation format.

## Return Type

The CBOR-encoded attestation object as a Hex string.

`Hex.Hex`
