2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
안전한 NFC
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Android에서는 오프 호스트 카드 에뮬레이션, 즉 보안 요소가 있는 NFC 카드 에뮬레이션을 지원합니다. 자세한 내용은 호스트 기반 카드 에뮬레이션 개요를 참조하세요.
대중교통용 FeliCa 사용과 같은 특정 사용 사례에서는 기기 화면이 잠겨 있거나 꺼져 있을 때 또는 기기가 꺼져 있을 때 오프 호스트 카드 에뮬레이션이 허용됩니다.
보안 NFC는 Android 10에서 도입된 기능으로 기기 화면이 잠금 해제된 경우에만 오프 호스트 NFC 카드 에뮬레이션을 사용 설정하도록 허용합니다. 이 기능을 구현하면 보안 NFC를 사용 설정하는 옵션을 사용자에게 제공하여 보안을 강화할 수 있습니다.
구현
보안 NFC 기능을 구현하려면 기기에는 NCI 2.0 표준을 지원하는 NFC 컨트롤러가 있어야 하며 Android 오픈소스 프로젝트(AOSP) NFC 프레임워크를 사용해야 합니다. config_skuSupportsSecureNfc
속성을 사용하여 NFC 리소스 XML 파일의 보안 NFC 기능을 지원하는 하드웨어(ro.boot.hardware.sku
)를 추가합니다.
프레임워크 API
보안 NFC를 구현하려면 Android 오픈소스 프로젝트에 있는 다음 프레임워크 API를 구현하세요.
설정 UI
설정 애플리케이션에서 사용자가 보안 NFC 기능을 사용 설정 또는 사용 중지할 수 있도록 전환 스위치를 추가합니다. 설정 애플리케이션의 기본 설정을 사용 설정 또는 사용 중지로 맞춤설정할 수 있습니다.
그림 1은 설정 앱의 설정 > 연결된 기기 > 연결 환경설정 > NFC > NFC 사용 시 기기 잠금 해제 필요에서 보안 NFC를 사용 설정 또는 사용 중지하는 전환 스위치의 예를 보여줍니다.
그림 1. 보안 NFC를 사용 설정 또는 사용 중지하는 전환 스위치의 예
보안 NFC가 사용 설정되어 있고 사용자가 기기를 NFC 리더에 놓으면 Android는 그림 2와 같이 잠금 화면에 잠금 해제하여 NFC 사용 알림을 표시합니다.
그림 2. 잠금 해제하여 잠금 화면에서 NFC 알림 사용
유효성 검사
구현을 확인하려면 보안 NFC 기능을 사용 설정하고 기기의 화면이 꺼져 있거나 잠겨 있을 때 및 기기가 꺼져 있을 때 NFC 카드 에뮬레이션이 사용 중지되어 있는지 확인합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2024-05-01(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-05-01(UTC)"],[],[],null,["# Secure NFC\n\nAndroid supports off-host card emulation, which means\nNFC card emulation with a secure element. For more information, see\n[Host-based card emulation overview](https://developer.android.com/guide/topics/connectivity/nfc/hce).\n\nIn certain use cases such as using\n[FeliCa](https://en.wikipedia.org/wiki/FeliCa)\nfor transit, off-host card\nemulation is permitted when a device's screen is locked or turned off, or\nwhen a device is turned off.\n\nSecure NFC is a feature introduced in Android 10\nthat allows off-host NFC card\nemulation to be enabled only when the device's screen is unlocked. Implementing\nthis feature gives users the option to enable Secure NFC for\nimproved security.\n\nImplementation\n--------------\n\nTo implement the Secure NFC feature, the device must have an NFC controller that\nsupports the NCI 2.0 standard and must use the Android Open Source Project\n(AOSP) NFC framework. Add the hardware (`ro.boot.hardware.sku`) that supports\nthe Secure NFC feature in the NFC\n[resource XML file](https://android.googlesource.com/platform/packages/apps/Nfc/+/refs/heads/android16-release/res/values/config.xml)\nwith the `config_skuSupportsSecureNfc` attribute.\n\n### Framework APIs\n\nTo implement Secure NFC, implement the following framework APIs found in the\nAndroid Open Source Project:\n\n- [`isSecureNfcSupported()`](https://developer.android.com/reference/android/nfc/NfcAdapter#isSecureNfcSupported()): Checks if the device supports the Secure NFC feature.\n- [`isSecureNfcEnabled()`](https://developer.android.com/reference/android/nfc/NfcAdapter#isSecureNfcEnabled()): Checks if the Secure NFC feature is enabled.\n- [`enableSecureNfc(boolean enable)`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/core/java/android/nfc/NfcAdapter.java#1722): Enables the Secure NFC feature.\n\n### Settings UI\n\nIn the Settings application, add a toggle switch to allow users to enable and\ndisable the Secure NFC feature. You can customize the default setting in the\nSettings application to be either enabled or disabled.\n\nFigure 1 shows an example of a toggle switch to enable and disable Secure NFC\nin the Settings app in **Settings \\\u003e Connected devices \\\u003e\nConnection preferences \\\u003e NFC \\\u003e Require device unlock for NFC**.\n\n**Figure 1.** Example toggle switch to enable and disable Secure NFC\n\nWhen Secure NFC is enabled and a user places the device on an NFC reader,\nAndroid displays the **Unlock to use NFC** notification on the lock screen\nas shown in Figure 2.\n\n**Figure 2.** Unlock to use NFC notification on the lock screen\n\nValidation\n----------\n\nTo validate your implementation, enable the Secure NFC feature and verify that\nNFC card emulation is disabled when the device's screen is off or locked, and\nwhen the device is turned off."]]