<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DeviceCheck",
  "identifier" : "/documentation/DeviceCheck/DCAppAttestService",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "DeviceCheck"
    ],
    "preciseIdentifier" : "c:objc(cs)DCAppAttestService"
  },
  "title" : "DCAppAttestService"
}
-->

# DCAppAttestService

A service that you use to validate the instance of your app running on a
device.

```
class DCAppAttestService
```

## Overview

Use the [`shared`](/documentation/DeviceCheck/DCAppAttestService/shared) instance of the
[`DCAppAttestService`](/documentation/DeviceCheck/DCAppAttestService) class to assert the legitimacy of a
particular instance of your app to your server. After ensuring service
availability by reading the [`isSupported`](/documentation/DeviceCheck/DCAppAttestService/isSupported)
property, you use the service to:

- Create a cryptographic key in the Secure Enclave by calling the
  [`generateKey(completionHandler:)`](/documentation/DeviceCheck/DCAppAttestService/generateKey(completionHandler:)) method.
- Ask Apple to certify the key by calling the
  [`attestKey(_:clientDataHash:completionHandler:)`](/documentation/DeviceCheck/DCAppAttestService/attestKey(_:clientDataHash:completionHandler:))
  method. - Prepare an assertion of your app’s integrity to accompany any or
  all server requests using the
  [`generateAssertion(_:clientDataHash:completionHandler:)`](/documentation/DeviceCheck/DCAppAttestService/generateAssertion(_:clientDataHash:completionHandler:))
  method.

For more information about how to support App Attest in your app, see
[Establishing your app’s integrity](/documentation/DeviceCheck/establishing-your-app-s-integrity). For information about the
complementary procedures you implement on your server, see
[Validating apps that connect to your server](/documentation/DeviceCheck/validating-apps-that-connect-to-your-server).

> Note: To use the App Attest service, your app must have an app ID that you
> register on the [Apple Developer](https://developer.apple.com/account/)
> website.

## Topics

### Accessing the service

[`shared`](/documentation/DeviceCheck/DCAppAttestService/shared)

The shared App Attest service that you use to validate your app.

[`isSupported`](/documentation/DeviceCheck/DCAppAttestService/isSupported)

A Boolean value that indicates whether a particular device provides the App
Attest service.

### Preparing a key

[`generateKey(completionHandler:)`](/documentation/DeviceCheck/DCAppAttestService/generateKey(completionHandler:))

Creates a new cryptographic key for use with the App Attest service.

[`attestKey(_:clientDataHash:completionHandler:)`](/documentation/DeviceCheck/DCAppAttestService/attestKey(_:clientDataHash:completionHandler:))

Asks Apple to attest to the validity of a generated cryptographic key.

### Validating the app instance

[`generateAssertion(_:clientDataHash:completionHandler:)`](/documentation/DeviceCheck/DCAppAttestService/generateAssertion(_:clientDataHash:completionHandler:))

Creates a block of data that demonstrates the legitimacy of an instance of
your app running on a device.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)