> 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/ja/implement-nfc-wallet/handle-cdcvm.md).

# CDCVM を処理する

## 概要

NFC Wallet SDK は、CDCCVM、オンライン PIN、署名など、支払い時にエンドユーザーを認証するための複数の CVM（Cardholder Verification Method）をサポートしています。

CDCVM（Consumer Device Cardholder Verification Method）は、デバイスに依拠して **エンドユーザーを** NFC 支払い前に検証する CVM です。

ほとんどの NFC Wallet プログラムでは **CDCVM**を使用します。CDCVM はデバイスのユーザー認証に依存します。

このセクションでは、NFC Wallet SDK が CDCVM として Android のセキュアなデバイスロック解除方法に依存していることを説明します。

### CDCVM Android（デバイスのロック解除）

Android 向け NFC Wallet SDK は、CDCVM に Android の安全なロックスクリーンを使用します。以下をサポートします：

* **生体認証**：指紋や顔などの強力な生体認証情報。
* **デバイス認証情報（keyguard）**：PIN、パターン、またはパスワード。

{% hint style="info" %}
NFC Wallet は Android Keystore のユーザー認証を使用します。参照： [Android Keystore のユーザー認証](https://developer.android.com/privacy-and-security/keystore#UserAuthentication).
{% endhint %}

### 推奨事項

統合の早い段階で CDCVM を扱ってください：

* ウォレットの登録やトークナイゼーションを開始する前に、デバイスの CDCVM 機能を確認してください。
* 必要に応じて、エンドユーザーに安全なロックスクリーンを有効にするよう促してください。

{% hint style="warning" %}

## NFC デバイス機能の確認

の記載どおり、デバイスが HCE をサポートしていることを確認してください。 [NFC 機能を宣言する](/nfc-wallet-sdk-android/ja/get-started/configuration/3.-application-manifest-file.md#declare-nfc-features)。確認は、アプリケーションのインストール時（Google Play のデバイスフィルタリング）または実行時に行えます。

実行時チェックを使用する場合は、対応していないデバイスでは NFC Wallet の機能を非表示にしてください。
{% endhint %}

## SDK の統合

### デバイスの CDCVM 機能を確認する

を使用して `DeviceCVMEligibilityChecker.checkDeviceEligibility` デバイス機能を確認します。

これは `DeviceCVMEligibilityResult`を返します。生体認証と keyguard のサポートを評価するために使用してください。

この確認は、 [NFC Wallet SDK を初期化した後](/nfc-wallet-sdk-android/ja/get-started/configuration/4.-initialize-the-nfc-wallet-sdk.md)、かつウォレットの登録やトークナイゼーションを開始する前に実行してください。

#### 生体認証のサポートを確認する

呼び出します `DeviceCVMEligibilityResult.getBiometricsSupport`.

返されるのは `BiometricSupport.SUPPORTED` で、生体認証 CDCVM が利用可能な場合です。生体認証がサポートされていない場合の可能なエラーは、下の表を確認してください。

<details>

<summary>生体認証の有効性エラー</summary>

| 結果                               | 説明                                               |
| -------------------------------- | ------------------------------------------------ |
| ANDROID\_VERSION\_NOT\_SUPPORTED | デバイスが Android 6.0（API レベル 23）より前で動作している場合に返されます。 |
| NO\_FINGERPRINT\_SENSOR          | デバイスで利用可能な生体認証センサーがない場合に返されます。                   |
| NO\_FINGERPRINT\_ENROLLED        | エンドユーザーがデバイスに生体認証を登録していない場合に返されます。               |
| PERMISSION\_NOT\_GRANTED         | 必要な生体認証権限が manifest にない場合に返されます。                 |
| SECURE\_LOCK\_NOT\_PRESENTED     | デバイスで安全なロックスクリーンが有効になっていない場合に返されます。              |

</details>

#### デバイス keyguard のサポートを確認する

呼び出します `DeviceCVMEligibilityResult.getDeviceKeyguardSupport`.

返されるのは `DeviceKeyguardSupport.SUPPORTED` で、デバイス keyguard CDCVM が利用可能な場合です。keygard がサポートされていない場合の可能なエラーは、下の表を確認してください。

<details>

<summary>デバイス keyguard の有効性エラー</summary>

| 結果                               | 説明                                               |
| -------------------------------- | ------------------------------------------------ |
| ANDROID\_VERSION\_NOT\_SUPPORTED | デバイスが Android 6.0（API レベル 23）より前で動作している場合に返されます。 |
| SECURE\_LOCK\_NOT\_PRESENTED     | デバイスで PIN、パターン、またはパスワードが有効になっていない場合に返されます。       |

</details>

### 実装例

```java
// CDCVM を選択するためのデバイスの有効性を確認
DeviceCVMEligibilityResult result =
        DeviceCVMEligibilityChecker.checkDeviceEligibility(getApplicationContext());

if(result.getBiometricsSupport() == BiometricsSupport.SUPPORTED) {
    // 生体認証はサポートされています
    // ...
}
else if(result.getDeviceKeyguardSupport() == DeviceKeyguardSupport.SUPPORTED){
    // 生体認証がサポートされていない場合は、デバイス KeyGuard を使用する必要があります。
    // デバイス keyguard はサポートされています
    // ...
}
else {
    // エラーをログに記録、デバイスはサポートされていません
    // またはエンドユーザーが安全なロックスクリーンを有効にしていません
    // エンドユーザーに安全なロックスクリーンを有効にするよう促すことを推奨します
    // ...
}
```


---

# 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:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/ja/implement-nfc-wallet/handle-cdcvm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
