내용으로 건너뛰기

Capgo 앱 attestation Capgo 저장소

GitHub

안드로이드에서 이 플러그인은 Google Play Integrity Standard API:

  • prepareIntegrityToken 동안 prepare()
  • requestStandardIntegrityToken 위하여 createAttestation()createAssertion()

필수 조건

필수 조건
  • 안드로이드 앱이 구글 플레이 스토어를 통해 배포되었습니다.
  • 기기에 구글 플레이 서비스가 사용 가능합니다.
  • 플레이 인테그리티 API가 앱에 활성화되어 있습니다.
  • 구글 클라우드 프로젝트 번호가 설정되어 있습니다.

구글 설정

활성화
  1. Enable Play Integrity API Google Cloud 프로젝트에서 사용하세요.
  2. Play Console을 열고 앱에 대한 Play Integrity 접근 권한을 구성하세요.
  3. 제공 cloudProjectNumber 플러그인에

Capacitor config

Capacitor config
capacitor.config.ts
plugins: {
AppAttest: {
cloudProjectNumber: '123456789012',
},
}

또는 cloudProjectNumber 메소드 옵션에 호출당한

클라이언트 흐름

Client flow
import { AppAttest } from '@capgo/capacitor-app-attest';
const { keyId } = await AppAttest.prepare({
cloudProjectNumber: '123456789012',
});
const attestation = await AppAttest.createAttestation({
keyId,
challenge: 'backend-registration-challenge',
});
const assertion = await AppAttest.createAssertion({
keyId,
payload: 'backend-request-payload',
});

token Play Integrity 토큰으로, 서버측에서 디코딩해야 합니다.

Android 백엔드 워크플로우

Backend workflow (Android)

등록 (createAttestation)createAttestation)

백엔드가 일회용
  1. 앱이 challenge.
  2. 백엔드가 Google createAttestation({ keyId, challenge }).
  3. __CAPGO_KEEP_0__. decodeIntegrityToken API.
  4. Copy to clipboard
    • requestDetails.requestHash === base64url(SHA256(challenge))
    • appIntegrity.packageName Android 애플리케이션 ID와 같습니다.
    • appIntegrity.certificateSha256Digest 릴리스 서명 인증서 해시를 포함합니다.
    • 보안 정책에 따라서完整성 판결이 일치합니다.

보호를 요청하세요 (createAssertion)createAssertion)

보호를 요청하세요 (createAssertion)
  1. 백엔드가 일회용 payload.
  2. 앱이 createAssertion({ keyId, payload }).
  3. 백엔드가 토큰을 해독하고 requestHash === base64url(SHA256(payload)).
  4. 재생 방지 (단일 사용 + TTL) 및完整성 판결 정책을 강제합니다.

Android 스키마

Android 스키마
sequenceDiagram
participant App as Android App
participant Plugin as AppAttest plugin
participant PlaySDK as Play Integrity SDK
participant BE as Backend
participant Google as decodeIntegrityToken API
App->>Plugin: prepare(cloudProjectNumber)
Plugin->>PlaySDK: prepareIntegrityToken()
PlaySDK-->>Plugin: provider handle (keyId)
BE->>App: one-time challenge
App->>Plugin: createAttestation(keyId, challenge)
Plugin->>PlaySDK: requestStandardIntegrityToken(requestHash)
PlaySDK-->>Plugin: integrity token
Plugin-->>App: token + platform + format + keyId
App->>BE: token + challenge + keyId
BE->>Google: decodeIntegrityToken(token)
Google-->>BE: decoded payload
BE->>BE: verify requestHash + app identity + verdicts
BE->>App: one-time payload
App->>Plugin: createAssertion(keyId, payload)
Plugin->>PlaySDK: requestStandardIntegrityToken(requestHash)
PlaySDK-->>Plugin: integrity token
App->>BE: token + payload + keyId
BE->>Google: decodeIntegrityToken(token)
Google-->>BE: decoded payload
BE->>BE: verify requestHash + replay policy

최소 백엔드 페이로드 계약

최소 백엔드 페이로드 계약 섹션

등록:

{
"platform": "android",
"format": "google-play-integrity-standard",
"keyId": "string",
"challenge": "string",
"token": "string"
}

보증:

{
"platform": "android",
"format": "google-play-integrity-standard",
"keyId": "string",
"payload": "string",
"token": "string"
}

안드로이드 설정 및 백엔드 확인에서 계속

안드로이드 설정 및 백엔드 확인에서 계속하는 경우

이러한 기능을 사용하는 경우 안드로이드 설정 및 백엔드 확인 안드로이드 설정 및 백엔드 확인을 사용하여 보안 및 규정 준수를 계획하고 capgo/capacitor-앱-인증 Capgo의 Native 기능을 사용하는 @capgo/capacitor-app-attest에 대해 암호화 Capgo의 암호화 구현 세부 정보에 대해 규정 준수 Capgo의 규정 준수 구현 세부 정보에 대해 Capgo 보안 스캐너 Capgo 보안 스캐너의 제품 워크플로우에 대해, 그리고 Capgo 보안 Capgo 보안의 제품 워크플로우에 대해