# UpdateSettingsFlowWithDeviceAuthnMethodRegister

Enrolls a new device key from a hardware-backed platform attestation. Provide exactly one of certificate_chain_android or attestation_ios. The attestation must embed the enrollment challenge, computed as follows:  1. Base64-decode the settings flow\'s hidden `deviceauthn_nonce` UI node value, parse the result as JSON, and base64-decode its `nonce` field. 2. For a key without a PIN, the raw nonce bytes are the challenge. For a PIN-protected key, the challenge is the SHA-256 of the raw nonce concatenated with the raw transport_public_key bytes, which binds the transport key into the attestation.  For a PIN-protected key the server returns a one-time sealed pin_secret in the flow\'s `continue_with` items (action `show_pin_entry_ui`).

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**attestation_ios** | **string** | The CBOR-encoded Apple App Attest attestation object for the new key. Generate the key with &#x60;DCAppAttestService.generateKey&#x60;, then obtain the attestation with &#x60;DCAppAttestService.attestKey&#x60;, passing the enrollment challenge described above as the &#x60;clientDataHash&#x60; argument — do not hash it again — and submit the result unchanged. Set exactly one of certificate_chain_android or attestation_ios. | [optional] [default to undefined]
**certificate_chain_android** | **Array&lt;string&gt;** | The Android Key Attestation certificate chain for the new key, one base64-encoded DER certificate per element, leaf first: the first element certifies the on-device key, the last is the Google attestation root.  Generate the key on-device (imported keys are rejected) in the hardware-backed keystore as an elliptic-curve (P-224, P-256, P-384, or P-521) signing key: &#x60;KeyGenParameterSpec.Builder(alias, PURPOSE_SIGN)&#x60; with &#x60;DIGEST_SHA256&#x60; and &#x60;setAttestationChallenge(challenge)&#x60;, where challenge is the enrollment challenge described above. Then submit the chain returned by &#x60;KeyStore.getCertificateChain&#x60;. Set exactly one of certificate_chain_android or attestation_ios. | [optional] [default to undefined]
**device_name** | **string** | A human-readable name for the device, e.g. \&#39;My work phone\&#39;. It helps the user tell this key apart from others. | [default to undefined]
**pin_protected** | **boolean** | Set to true to enroll the key as PIN-protected. The server then mints a 32-byte pin_secret and returns it exactly once, in the settings-flow response: the &#x60;continue_with&#x60; array contains an item with action &#x60;show_pin_entry_ui&#x60; whose &#x60;data.enc&#x60; (HPKE encapsulated key) and &#x60;data.ciphertext&#x60; (sealed pin_secret) fields are base64-encoded and sealed to transport_public_key. Open them on the device with the transport private key using HPKE with DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, AES-128-GCM, the ASCII info string \&quot;ory/deviceauthn/pin-secret/v1\&quot;, and the client_key_id (its ASCII hex form) as the AAD, then bind the secret to the user\&#39;s PIN locally. The sealed secret is never delivered again; logins with the key must then include a pin_proof. | [optional] [default to undefined]
**transport_public_key** | **string** | The device\&#39;s X25519 transport public key (32 bytes, base64-encoded) used to seal the returned pin_secret so only this device can open it. Required when pin_protected is true, ignored otherwise.  Generate a fresh, random X25519 key pair for each request — for example with CryptoKit\&#39;s &#x60;Curve25519.KeyAgreement.PrivateKey()&#x60; on iOS or &#x60;KeyPairGenerator.getInstance(\&quot;XDH\&quot;)&#x60; on Android — and submit the raw 32-byte public key. It is a transport-encryption key, distinct from the attested signing key. Keep the private key only until the sealed pin_secret from the response has been opened, then discard it. The HPKE suite is DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, AES-128-GCM. | [optional] [default to undefined]
**user_verification** | [**UserVerification**](UserVerification.md) | Declares how the key\&#39;s holder is verified at use time. One of \&quot;pin\&quot;, \&quot;platform\&quot;, or \&quot;none\&quot; (or empty, which maps to \&quot;none\&quot;). \&quot;pin\&quot; is implied by pin_protected and need not be set explicitly.  For \&quot;platform\&quot; on Android, generate the key with &#x60;setUserAuthenticationRequired(true)&#x60;: the server rejects the claim unless the attestation shows user-authentication gating (KeyMint user_auth_type). On iOS the declaration is trusted, since App Attest cannot prove biometric gating; iOS platform keys therefore count as a sole first factor only when the project enables ios_biometric_first_factor. | [optional] [default to undefined]
**version** | **number** | The cryptography version to enroll the key with. Only &#x60;1&#x60; is currently supported, which corresponds to ECDSA with SHA-256 on an elliptic curve (P-224, P-256, P-384, or P-521). | [default to undefined]

## Example

```typescript
import { UpdateSettingsFlowWithDeviceAuthnMethodRegister } from '@ory/client';

const instance: UpdateSettingsFlowWithDeviceAuthnMethodRegister = {
    attestation_ios,
    certificate_chain_android,
    device_name,
    pin_protected,
    transport_public_key,
    user_verification,
    version,
};
```

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
