> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/implement-nfc-wallet/tokenize-a-card/set-cdcvm-method.md).

# Set CDCVM method

## Overview

The digital card profile defines whether it supports CDCVM.

For a given wallet instance, the **first provisioned card that supports CDCVM** defines the **CDCVM method** used by the **digital wallet application**.

NFC Wallet SDK does not allow cards with different CDCVM methods to co-exist in the same wallet instance.

As described in [Handle CDCVM](/nfc-wallet-sdk-android/implement-nfc-wallet/handle-cdcvm.md), most NFC Wallet programs use CDCVM.

In this section, you set the CDCVM method based on device capabilities during **Tokenization** of the first card that supports CDCVM.

{% hint style="danger" %}
**Setting the CDCVM method is Required**

If the profile supports CDCVM and you do not set the CDCVM method:

* Retrieving the card list fails with `DigitalizedCardErrorCodes.CD_CVM_REQUIRED`.
* NFC payments fail until you set the CDCVM method.
  {% endhint %}

## SDK integration

### Check whether CDCVM is supported and set

Use `CHVerificationManager` to check whether CDCVM is supported and already configured for the current wallet instance:

* `CHVerificationManager.isFCDCVMSupported()` checks whether CDCVM is supported.
* `CHVerificationManager.isFCdCvmSet()` checks whether the CDCVM method is already set.
* `CHVerificationManager.getDefaultFCdCvm()` returns the CDCVM method used by the digital wallet application.

If CDCVM is supported and not set, initialize it as described in [Set the CDCVM method](#set-the-cdcvm-method).

### Handle `CD_CVM_REQUIRED` when listing cards

If you do not set the CDCVM method and you retrieve the card list using `DigitalizedCardManager.getAllCards()`, the SDK can return `DigitalizedCardErrorCodes.CD_CVM_REQUIRED`. In such case initialize CDCVM method it as described in [Set the CDCVM method](#set-the-cdcvm-method).

```java
DigitalizedCardManager.getAllCards( new AbstractAsyncHandler<String[]> () {
    
    @Override
    public void onComplete(final AsyncResult<String[]> asyncResult) {
        if (asyncResult.isSuccessful()) {
            // Card list retrieved successfully
        }
        else {
            // Card list retrieval failed
            final int errorCode = asyncResult.getErrorCode();
            if (errorCode == DigitalizedCardErrorCodes.CD_CVM_REQUIRED) {
                // Set the CDCVM method here (see next section)
                // ....
            }
        }
    }
    
});
```

### Set the CDCVM method

Use `DeviceCVMManager.initialize(...)` to set the CDCVM method according to device capabilities:

* **Biometric**: `CHVerificationMethod.BIOMETRICS`
* **Device credentials (keyguard)**: `CHVerificationMethod.DEVICE_KEYGUARD`

{% hint style="info" %}
After you set the CDCVM method, consider scenarios where the end user changes the device unlock method. See [Device unlock method update scenario](/nfc-wallet-sdk-android/implement-nfc-wallet/tokenize-a-card/set-cdcvm-method/device-unlock-method-update-scenarios.md).
{% endhint %}

#### Implementation example

```java
// Check device eligibility for CDCVM
DeviceCVMEligibilityResult result =
        DeviceCVMEligibilityChecker.checkDeviceEligibility(getApplicationContext());

if (result.getBiometricsSupport() == BiometricsSupport.SUPPORTED) {
    // Biometric is supported
    try {
        DeviceCVMManager.INSTANCE.initialize(CHVerificationMethod.BIOMETRICS);
    } catch (DeviceCVMException e) {
        // Handle error
    }
}
else if (result.getDeviceKeyguardSupport() == DeviceKeyguardSupport.SUPPORTED) {
    // If biometrics are not supported, use device keyguard.
    try {
        DeviceCVMManager.INSTANCE.initialize(CHVerificationMethod.DEVICE_KEYGUARD);
    } catch (DeviceCVMException e) {
        // Handle error
    }
}
else {
    // Device does not support CDCVM, or the end user did not enable a secure lock screen.
    // Prompt the end user to enable biometrics or device credentials.
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/implement-nfc-wallet/tokenize-a-card/set-cdcvm-method.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
