__CAPGO_KEEP_0__

Getting Started

  1. パッケージをインストール

    ターミナル画面
    bun add @capgo/capacitor-app-attest
  2. ネイティブプロジェクトを同期

    ターミナル画面
    bunx cap sync
  3. プラットフォーム要件を設定

    • 完了 iOS設定 App Attest機能とバックエンド検証フロー用
    • 完了 Android設定 Play Integrity Standardとバックエンド検証フロー用。

このプラグインは、ネイティブプラットフォームのセキュリティを維持しながら、1つのクロスプラットフォームAPIを提供します。

  • iOS: Apple App Attest (DeviceCheck)
  • Android: Google Play Integrity StandardAPI
  • カスタムクライアントサイド暗号化スキームなし
  • バックエンドチェック用に標準化された出力
import { AppAttest } from '@capgo/capacitor-app-attest';
const support = await AppAttest.isSupported();
if (!support.isSupported) {
throw new Error(`Attestation not supported on ${support.platform}`);
}
const prepared = await AppAttest.prepare();
const registration = await AppAttest.createAttestation({
keyId: prepared.keyId,
challenge: 'backend-one-time-registration-challenge',
});
const assertion = await AppAttest.createAssertion({
keyId: prepared.keyId,
payload: 'backend-one-time-request-payload',
});
console.log(registration.platform, registration.format, registration.token);
console.log(assertion.platform, assertion.format, assertion.token);

createAttestation() そして createAssertion() iOS と Android で同じキーフィールドを返します:

フィールドタイプトークンを生成したネイティブプラットフォーム
platform'ios' | 'android' | 'web'または
formatAttestationFormatapple-app-attest 証明のために使用されるキーやプロバイダーのハンドル google-play-integrity-standard
keyIdstringサーバー側で検証するトークン
tokenstringバックエンドの要件

証明はサーバー側で検証された場合にのみ有効です。

  • クライアントのみの成功は信頼できません。
  • バックエンドから一時的なチャレンジ/ペイロード値を要求してください。
  • バックエンドのロジックでアプリのアイデンティティとリプレイ保護を検証してください。 tokenプラットフォーム固有のバックエンドガイドを使用してください:

iOSのセットアップとバックエンドの検証

Getting Startedから続けてくださいのセクション

Capgoを使用している場合

If you are using スタート __CAPGO_KEEP_0__をセキュリティとコンプライアンスの計画に接続する capgo/capacitor-app-attestを使用する capgo/capacitor-app-attestのネイティブ機能について 暗号化 暗号化の実装詳細について コンプライアンス コンプライアンスの実装詳細について Capgo セキュリティ スキャナー Capgo セキュリティ スキャナーの製品ワークフローについて Capgo セキュリティ Capgo セキュリティの製品ワークフローについて