ใช้การรับรองด้วยฮาร์ดแวร์สำหรับข้อมูลเข้าสู่ระบบดิจิทัล

ในขั้นตอนการออกข้อมูลประจำตัวดิจิทัลทั่วไปโดยใช้ข้อกำหนด OpenID สำหรับการออกข้อมูลประจำตัวที่ตรวจสอบได้ (OpenID4VCI) ผู้ออก ต้องทราบว่าระบบจัดเก็บคีย์ภายในข้อมูลประจำตัวที่จะลงนามไว้ในตำแหน่งที่ปลอดภัย android_keystore_attestation ประเภทหลักฐาน ซึ่งเป็นรูปแบบสำหรับ ใช้กับ OpenID4VCI จะแสดงรายงานที่ลงนามด้วยฮาร์ดแวร์จาก Android Keystore เพื่อให้มั่นใจว่าคีย์จะล็อกอยู่ในสภาพแวดล้อมการดำเนินการที่เชื่อถือได้ (TEE) หรือ StrongBox และจะส่งออกหรือโคลนไม่ได้

ภาพรวมการรับรองฮาร์ดแวร์

เมื่อสร้างคีย์ในคีย์สโตร์ของ Android ระบบจะสร้าง ใบรับรองการรับรองได้ ใบรับรองนี้ได้รับการลงนามด้วยคีย์ที่ได้รับการปกป้องโดยฮาร์ดแวร์ของอุปกรณ์ ซึ่งเชื่อมโยงกลับไปยังรูทของความน่าเชื่อถือที่ Google ถือครอง

android_keystore_attestation หลักฐานคืออาร์เรย์ของห่วงโซ่ใบรับรอง X.509 แต่ละเชนแสดงถึงคีย์การตรวจสอบสิทธิ์เดียวและมีโครงสร้างเป็น ใบรับรองปลายทางตามด้วยใบรับรองระดับกลาง

  • ใบรับรองปลายทาง: มีคีย์และส่วนขยายการรับรองเฉพาะ Android
  • ใบรับรองกลาง: เชื่อมต่อใบรับรอง Leaf กับรูทของ Android

ขั้นตอนการยืนยัน

ผู้ออกควรทำการตรวจสอบความถูกต้องหลายครั้งในการรับรอง

  • ค้นหาใบรับรองในเชนที่มีส่วนขยายการรับรอง Android (โดยปกติคือใบรับรองปลายทาง) ใบรับรองนี้มี ข้อมูลการรับรองสำหรับคีย์ที่สร้างโดย Android Keystore
  • ตรวจสอบว่าฟิลด์ attestationChallenge ในส่วนขยายตรงกับ c_nonce ที่โปรโตคอลระบุเพื่อป้องกันการโจมตีแบบรีเพลย์
  • ยืนยันค่าของการยืนยันทั้งหมดในส่วนขยายที่คุณสนใจ
  • ตรวจสอบการเพิกถอนใบรับรอง Android Keystore

ค่าในหลักฐานการรับรองมาจากแหล่งที่มาหลายแห่ง ดังนี้

  • ผู้ออกบัตร: ผู้ออกบัตรจะระบุค่าต่างๆ และค่าที่พบบ่อยที่สุดคือ ระบุในรูปแบบข้อมูลเมตาของผู้ออกบัตรเพื่อให้กรองได้เมื่อนำเสนอ
  • ผู้ถือครอง: ค่าต่างๆ เช่น ชื่อแพ็กเกจและลายเซ็นมาจากผู้ถือครอง โดยจะไม่มีการแชร์ผ่านขั้นตอนการออกบัตรมาตรฐานและต้องขอจากผู้ถือบัตรโดยตรง
  • โปรโตคอล: ค่าต่างๆ เช่น Nonce ที่มี attestationChallenge มาจากโปรโตคอล

ดูวิธีการที่สมบูรณ์เพิ่มเติมเกี่ยวกับการตรวจสอบข้อมูลการรับรองได้ที่แหล่งข้อมูลต่อไปนี้

รูปแบบหลักฐานการรับรอง

ในคำขอข้อมูลเข้าสู่ระบบ android_keystore_attestation จะรวมอยู่ในตัวอย่างต่อไปนี้

{
  "type": "array",
  "description": "An array of certificate chains. Each chain attests a single key.",
  "items": {
    "type": "array",
    "description": "An X.509 certificate chain. Each certificate is a Base64-encoded string. The first element in the chain is the leaf certificate with the extension, the last is the Android Keystore root certificate.",
    "items": {
      "type": "string",
      "description": "A single X.509 certificate (Base64-NoWrap padded DER encoded)."
    },
    "minItems": 1
  },
  "minItems": 1
}

จากนั้นจะจัดเก็บไว้ในออบเจ็กต์ proofs ของคำขอข้อมูลเข้าสู่ระบบ

{
  "credential_configuration_id": "org.iso.18013.5.1.mDL",
  "proofs": {
    "android_keystore_attestation": [
      [
        "MII...", // Leaf certificate (contains Keystore extension)
        "MII...", // Intermediate certificate
        "MII..."  // Android Root certificate
      ],
      [ "MII...", "MII...", "MII..." ] // second proof
    ]
  }
}

รูปแบบข้อมูลเมตาของผู้ออกใบรับรอง

ผู้ออกบัตรจะระบุประเภทหลักฐานที่รองรับโดยรวมออบเจ็กต์ android_keystore_attestation ไว้ในออบเจ็กต์ proof_types_supported สำหรับการกำหนดค่าข้อมูลเข้าสู่ระบบที่ระบุ

นี่คือตัวอย่างออบเจ็กต์ android_keystore_attestation สำหรับผู้ออกบัตร

{
  "type": "object",
  "properties": {
    "proof_signing_alg_values_supported": {
      "type": "array",
      "description": "REQUIRED. As defined in OpenID4VCI 1.0 Section 12.2.4.",
      "items": {
        "type": "string",
        "description": "Cryptographic algorithm identifiers used in the proof_signing_alg_values_supported Credential Issuer metadata parameter for this proof type are case sensitive strings and SHOULD be one of those defined in [IANA.JOSE]."
      },
      "minItems": 1
    },
    "key_attestations_required": {
      "type": "object",
      "description": "OPTIONAL. Specifies the minimum attestation requirements.",
      "properties": {
        "key_mint_security_level": {
          "type": "string",
          "description": "OPTIONAL. Minimum accepted keyMintSecurityLevel. Values defined in https://source.android.com/docs/security/features/keystore/attestation#securitylevel-values.",
          "enum": ["Software", "TrustedEnvironment", "StrongBox"],
          "default": "TrustedEnvironment"
        },
        "user_auth_types": {
          "type": "array",
          "description": "OPTIONAL. A list of authentication types which can authorize the use of the key. If empty, no authentication is required. If multiple, any are allowed.",
          "items": {
            "type": "string",
            "description": "Allowed values are 'LSKF' and 'BIOMETRIC'. These values are meant to mimic the values used during the key generation process here.",
            "enum": ["LSKF", "BIOMETRIC"]
          },
          "default": []
        }
      }
    }
  },
  "required": ["proof_signing_alg_values_supported"]
}

ตัวอย่างออบเจ็กต์ proof_types_supported ด้านนอกมีดังนี้

{
  "credential_configurations_supported": {
    "org.iso.18013.5.1.mDL": {
      "format": "mso_mdoc",
      "doctype": "org.iso.18013.5.1.mDL",
      "cryptographic_binding_methods_supported": [
        "cose_key"
      ],
      "credential_signing_alg_values_supported": [
        -7, -9
      ],
      "proof_types_supported": {
        "android_keystore_attestation": {
          "proof_signing_alg_values_supported": [
            "ES256" // ecdsaWithSHA256
          ],
          "key_attestations_required" : {
            // OPTIONAL String - Representing the minimum accepted value for keyMintSecurityLevel values
            // defined here ("Software"|"TrustedEnvironment"|"StrongBox"). Default value: "TrustedEnvironment"
            "key_mint_security_level": "TrustedEnvironment",
            // OPTIONAL List of Strings - Representing all allowed values for userAuthType values defined here.
            // [] value will represent noAuthRequired. Default value: [].
            "user_auth_types": ["LSKF", "BIOMETRIC"]
          }
        }
      }
    }
  }
}

การแมปการอ้างสิทธิ์การรับรอง VCI กับ Android Keystore

ตารางนี้แสดงการแมปข้อมูลเพื่อช่วยให้หน่วยงานที่คุ้นเคยกับ ประเภทหลักฐานการรับรอง OpenID4VCI มาตรฐานเข้าใจว่าแนวคิดที่คล้ายกันอยู่ ที่ใดในการรับรอง Android Keystore

การอ้างสิทธิ์การรับรอง VCI

android_keystore_attestation ตำแหน่ง

ตำแหน่งมูลค่าที่คาดไว้

iss

คีย์สาธารณะของใบรับรองรูทของคีย์สโตร์

ไม่มี

iat

creationDateTime ค่าในส่วนขยายการรับรอง

ไม่มี

exp

validUntil ในใบรับรอง Leaf

ไม่มี

attested_keys

คีย์สาธารณะที่อยู่ในใบรับรองลีฟของแต่ละเชน

ไม่มี

key_storage

keyMintSecurityLevel ค่าในส่วนขยายการรับรอง

ผู้ออกบัตรที่เลือก: key_mint_security_level ฟิลด์ในข้อมูลเมตาของผู้ออกบัตร

user_authentication

ค่า userAuthType และ noAuthRequired ในส่วนขยายการรับรอง

ผู้ออกบัตรที่เลือก: user_auth_types ฟิลด์ในข้อมูลเมตาของผู้ออกบัตร

nonce

attestationChallenge ค่าในส่วนขยายการรับรอง

จากโปรโตคอล: c_nonce ค่าจากปลายทาง Nonce ที่อธิบายไว้ใน VCI

การรับรอง

ไม่มี

ไม่มี

status

ไม่มี

N/A