OpenID for Verifiable Credential Issuance(OID4VCI)
OID4VCI は、OAuth 2.0 を基盤として Verifiable Credential(検証可能なクレデンシャル)を発行するための仕様です。
第1部: 概要編
Verifiable Credential とは?
Verifiable Credential(VC)は、発行者がデジタル署名した検証可能な証明書です。
従来の証明書:
紙の証明書 → コピー・改ざんが容易
PDF → 電子透かし等で保護するが限定的
Verifiable Credential:
デジタル署名 → 改ざん検知可能
選択的開示 → 必要な情報のみ開示
分散型検証 → 発行者に問い合わせ不要
┌─────────────────────────────────────────────────┐
│ Verifiable Credential │
├─────────────────────────────────────────────────┤
│ @context: ["https://www.w3.org/..."] │
│ type: ["VerifiableCredential", "IDCard"] │
│ issuer: did:example:university │
│ issuanceDate: 2024-01-01 │
│ credentialSubject: │
│ name: 山田太郎 │
│ degree: 工学修士 │
│ proof: │
│ type: Ed25519Signature2020 │
│ verificationMethod: did:example:uni#key-1 │
│ proofValue: z3FXQjecWufY46... │
└─────────────────────────────────────────────────┘
OID4VCI の役割
OID4VCI は、既存の OAuth 2.0 インフラを活用して VC を発行する仕組みを提供します。
OID4VCI のフロー:
┌────────┐ ┌─────────────┐
│ Wallet │ │ Issuer │
│ (User) │ │ (大学、銀行) │
└────────┘ └─────────────┘
│ │
│ 1. Credential Offer を受け取る │
│ ◄─────────────────────────────────────── │
│ │
│ 2. 認可リクエスト(OAuth 2.0) │
│ ─────────────────────────────────────► │
│ │
│ 3. ユーザー認証・同意 │
│ ◄──────────────────────────────────────►│
│ │
│ 4. 認可コード / アクセストークン │
│ ◄─────────────────────────────────────── │
│ │
│ 5. Credential Request │
│ ─────────────────────────────────────► │
│ │
│ 6. Verifiable Credential │
│ ◄─────────────────────────────────────── │
└────────────────────────────── ────────────┘
主要なコンポーネント
| コンポーネント | 説明 |
|---|---|
| Credential Issuer | VC を発行するサービス |
| Wallet | ユーザーが VC を保管・管理するアプリ |
| Credential Offer | 発行者からウォレットへの発行提案 |
| Credential Endpoint | VC を発行するエンドポイント |
ユースケース
| ユースケース | 発行者 | Credential |
|---|---|---|
| 大学卒業証明 | 大学 | 学位証明書 |
| 運転免許証 | 行政機関 | mDL(モバイル運転免許証) |
| 従業員証明 | 企業 | 在籍証明書 |
| 銀行口座証明 | 銀行 | 口座保有証明 |
| 医療資格 | 医療機関 | 医師免許証 |
第2部: 詳細編
Credential Issuer Metadata
発行者のメタデータは /.well-known/openid-credential-issuer で公開されます。
{
"credential_issuer": "https://issuer.example.com",
"authorization_servers": ["https://auth.example.com"],
"credential_endpoint": "https://issuer.example.com/credentials",
"batch_credential_endpoint": "https://issuer.example.com/credentials/batch",
"deferred_credential_endpoint": "https://issuer.example.com/credentials/deferred",
"credential_configurations_supported": {
"UniversityDegree_jwt_vc_json": {
"format": "jwt_vc_json",
"scope": "UniversityDegree",
"cryptographic_binding_methods_supported": ["did:key", "did:web"],
"credential_signing_alg_values_supported": ["ES256", "ES384"],
"credential_definition": {
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"credentialSubject": {
"given_name": {
"display": [
{"name": "名", "locale": "ja"},
{"name": "Given Name", "locale": "en"}
]
},
"family_name": {
"display": [
{"name": "姓", "locale": "ja"},
{"name": "Family Name", "locale": "en"}
]
},
"degree": {
"display": [
{"name": "学位", "locale": "ja"},
{"name": "Degree", "locale": "en"}
]
}
}
},
"display": [
{
"name": "大学学位証明書",
"locale": "ja",
"logo": {
"uri": "https://issuer.example.com/logo.png"
},
"background_color": "#12107c",
"text_color": "#ffffff"
}
]
},
"DriverLicense_mso_mdoc": {
"format": "mso_mdoc",
"doctype": "org.iso.18013.5.1.mDL",
"cryptographic_binding_methods_supported": ["cose_key"],
"credential_signing_alg_values_supported": ["ES256"],
"display": [
{
"name": "運転免許証",
"locale": "ja"
}
]
}
}
}
Credential Offer
発行者がウォレットに VC 発行を提案します。
QR コードまたはディープリンク
openid-credential-offer://?credential_offer_uri=https://issuer.example.com/offers/abc123
または直接 JSON を含める:
openid-credential-offer://?credential_offer=%7B%22credential_issuer%22%3A...%7D
Credential Offer の構造
{
"credential_issuer": "https://issuer.example.com",
"credential_configuration_ids": [
"UniversityDegree_jwt_vc_json"
],
"grants": {
"authorization_code": {
"issuer_state": "eyJhbGciOiJSU0..."
},
"urn:ietf:params:oauth:grant-type:pre-authorized_code": {
"pre-authorized_code": "SplxlOBeZQQYbYS6WxSbIA",
"tx_code": {
"input_mode": "numeric",
"length": 6,
"description": "SMSで送信されたコードを入力してください"
}
}
}
}