データ構造
主要データ構造
PlantUML Diagram Loading...
情報
データ型は基本的にJSON形式の型を用いますが、説明のために例外的に以下の2つの型を用います。
- Date
日時情報。JSON上ではISO8601形式で表記されたstring型として取り扱います。 - Buffer
バイナリ(バイト配列)情報。JSON上ではBase64Url形式で表記されたstring型として取り扱います。
FSS WebAPIでは大きく「ユーザーデータ」と「クレデンシャルデータ」を取り扱います。
- ユーザーデータ
- 利用者の情報を扱います。
- 基本的には、WebAuthnにおけるPublicKeyCredentialUserEntityの情報を取り扱います。
- クレデンシャルデータ
- クレデンシャル(FIDO認証処理を行うための公開鍵など)の情報を取り扱います。
- 基本的には、WebAuthnにおけるPublicKeyCredential、その内部で使用されるAuthenticatorAttestationResponseの情報を取り扱います。
AuthenticatorAttestationResponse内でバイナリ形式で保持されている情報を取り扱いやすい形式に展開して保持しています。- ユーザーデータ1件に対して、クレデンシャルデータが0~n件関連付く形になります。
いずれのデータについても、FSS独自の項目として、attributesと呼ばれるアプリケーション独自の情報を保持するための項目と、無効フラグ項目が存在します。
ユーザーデータ
ユーザーデータの形式は以下のようになります。
interface UserData {
rpId : string,
userId : Buffer,
userName : string,
displayName : string | null,
userAttributes : { [key : string] : any} | null,
disabled : boolean,
registered : Date,
updated : Date,
enabledCredentialCount : number,
credentialCount : number,
}| キー | 型 | 内容 |
|---|---|---|
| rpId | string | RP ID。 |
| userId | Buffer | ユーザーID。PublicKeyCredentialUserEntityのidをBase64Urlエンコードした文字列。 |
| userName | string | ユーザー名。PublicKeyCredentialUserEntityのnameに相当。※ユーザーの識別自体はuserIdで行われるため、userNameの重複はデフォルトでは許可されるが、RP設定で重複を禁止する設定が可能。 |
| displayName | string | null | 表示名。PublicKeyCredentialUserEntityのdisplayNameに相当。 |
| userAttributes | { [key : string] : any } | null | ユーザー属性。FSS WebAPI利用者側で自由に設定可能な付加情報を格納する。JSONオブジェクト形式またはnullが設定可能。 |
| disabled | boolean | 無効フラグ。trueだった場合、レコードが無効となる。 |
| registered | Date | 登録日時をISO8601形式で表記した文字列。 |
| updated | Date | 更新日時をISO8601形式で表記した文字列。 |
| enabledCredentialCount | number | ユーザーに関連付く有効(disabledがfalse)なクレデンシャルデータの件数。 |
| credentialCount | number | ユーザーに関連付くクレデンシャルデータの件数。無効とされているクレデンシャルデータも含む。 |
クレデンシャルデータ
クレデンシャルデータの形式は以下のようになります。
interface CredentialData {
rpId : string,
userId : Buffer,
credentialId : Buffer,
credentialName : string | null,
credentialAttributes : { [key : string] : any} | null,
format : string,
userPresence : boolean,
userVerification : boolean,
backupEligibility : boolean,
backupState : boolean,
attestedCredentialData : boolean,
extensionData : boolean,
aaguid : string | null,
aaguidModelName : string | null,
publicKey : Buffer,
transportsRaw : string | null,
transportsBle : boolean | null,
transportsHybrid : boolean | null,
transportsInternal : boolean | null,
transportsNfc : boolean | null,
transportsUsb : boolean | null,
discoverableCredential : boolean | null,
enterpriseAttestation : boolean,
vendorId : string | null,
authenticatorId : string | null,
attestationObject : Buffer,
authenticatorAttachment : string | null,
credentialType : string,
clientDataJson : string,
clientDataJsonRaw : string,
lastAuthenticated : Date | null,
lastSignCounter : number | null,
disabled : boolean,
registered : Date,
updated : Date,
}| キー | 型 | 内容 |
|---|---|---|
| rpId | string | RP ID。 |
| userId | Buffer | ユーザーID。PublicKeyCredentialUserEntityのidをBase64Urlエンコードした文字列。 |
| credentialId | Buffer | クレデンシャルID。AttestedCredentialDataのcredentialIdをBase64Urlエンコードした文字列。 |
| credentialName | string | null | クレデンシャル名。FSS WebAPI利用者側がクレデンシャル登録時に任意で指定可能。 |
| credentialAttributes | { [key : string] : any} | null | クレデンシャル属性。FSS WebAPI利用者側で自由に設定可能な付加情報を格納する。JSONオブジェクト形式またはnullが設定可能。 |
| format | string | アテステーション形式。AttestationObjectのfmtに相当。 |
| userPresence | boolean | クレデンシャル登録時にユーザープレゼンスが行われた場合true。AuthenticatorDataのflagsのUPに相当。 |
| userVerification | boolean | クレデンシャル登録時にユーザー検証が行われた場合true。AuthenticatorDataのflagsのUVに相当。 |
| backupEligibility | boolean | クレデンシャル登録時にバックアップ適格性がある場合true。AuthenticatorDataのflagsのBEに相当。 |
| backupState | boolean | クレデンシャル登録時にバックアップが行われている場合true。AuthenticatorDataのflagsのBSに相当。 |
| attestedCredentialData | boolean | クレデンシャル登録時に証明資格情報が存在する場合true。AuthenticatorDataのflagsのATに相当。(AttestedCredentialDataが存在しない場合、クレデンシャルを登録できないため、常にtrueになります) |
| extensionData | boolean | クレデンシャル登録時に拡張情報が存在する場合true。AuthenticatorDataのflagsのEDに相当。 |
| aaguid | string | null | 登録された認証器のAAGUID。AttestedCredentialDataのaaguidに相当。 |
| aaguidModelName | string | null | AAGUIDとMDS(FIDO Alliance MetaData Service)から導き出された認証器モデル名。該当情報が存在しなかった場合null。 |
| publicKey | Buffer | 公開鍵。AttestedCredentialDataのcredentialPublicKeyに相当。 |
| transportsRaw | string | null | AuthenticatorAttestationResponseのgetTransports()メソッド実行結果に相当。registerCredential/finish呼び出し時パラメータにtransportsパラメータを設定する事で記録可能。 |
| transportsBle | boolean | null | 認証器がBLEでのトランスポートに対応している場合true。 |
| transportsHybrid | boolean | null | 認証器がハイブリッド認証でのトランスポートに対応している場合true。 |
| transportsInternal | boolean | null | 認証器が内部トランスポートに対応している場合true。 |
| transportsNfc | boolean | null | 認証器がNFCでのトランスポートに対応している場合true。 |
| transportsUsb | boolean | null | 認証器がUSBでのトランスポートに対応している場合true。 |
| discoverableCredential | boolean | null | 認証情報がDiscoverableCredentialの場合true。(credProps拡張のrk相当。credProps拡張に対応していないプラットフォームでは取得できない場合がある) |
| enterpriseAttestation | boolean | FSSがEnterpriseAttestationである事を確認できた場合true。 |
| vendorId | string | null | EnterpriseAtestationが確認できた場合のベンダーID(FSS独自定義)。2025/08時点ではyubicoのみ。 |
| authenticatorId | string | null | EnterpriseAtestationが確認できた場合のシリアル番号等の識別子。 |
| attestationObject | Buffer | AttestationObject全体。 |
| authenticatorAttachment | string | null | 認証機種別(プラットフォーム認証器・クロスプラットフォーム認証器)を示す文字列。PublicKeyCredentialのauthenticatorAttachmentに相当。 |
| credentialType | string | クレデンシャル種別。PublicKeyCredentialのtypeに相当。“public-key"固定。 |
| clientDataJson | string | クライアントデータJSON。AuthenticatorAttestationResponseのclientDataJSON項目をBase64Urlデコードしたものに相当。 |
| clientDataJsonRaw | Buffer | クライアントデータJSONのバイナリ表現。AuthenticatorAttestationResponseのclientDataJSON項目に相当。 |
| lastAuthenticated | Date | null | 最終認証日時。まだ認証を行っていない場合はnull。 |
| lastSignCounter | number | null | 最終認証時の内部カウンター値。AuthenticatorDataのsignCount項目に相当。 |
| disabled | boolean | 無効フラグ。trueだった場合、レコードが無効となる。 |
| registered | Date | 登録日時をISO8601形式で表記した文字列。 |
| updated | Date | 更新日時をISO8601形式で表記した文字列。 ※認証時に lastAuthenticatedとlastSignCounterが更新されるが、このデータ更新時にはupdatedは更新されません。 |
その他データ構造
一部API呼び出しで使用される型です。
クレデンシャル名設定データ
クレデンシャル登録時に、登録内容からクレデンシャル名を設定するためのデータ構造です。
この型に対してstringを指定した場合、nameプロパティのみを設定したものとみなされます。
type Fido2CredentialNameParameter = {
name : string;
nameIfModelNameExists? : string;
nameIfEnterpriseAttestationExists? : string;
} | string | undefined;| キー | 型 | 内容 |
|---|---|---|
| name | string | クレデンシャル名称。 |
| nameIfModelNameExists | string | AAGUIDから認証器種別が取得できた場合に使用されるクレデンシャル名称。省略された場合・認証器種別が取得できなかった場合はnameプロパティが使用される。 |
| nameIfEnterpriseAttestationExists | string | FSSがEnterpriseAttestationである事を確認できた場合に使用されるクレデンシャル名称。省略された場合・EnterpriseAttestationではなかった場合はnameIfModelNameExistsプロパティが使用される。 |
情報
Fido2CredentialNameParameterの各プロパティは、以下のプレースホルダーを含める事ができ、登録時に実際の値に置換されます。
$$:$に置換されます。$modelName: AAGUIDから導出された製品モデル名。$authenticatorId: EnterpriseAttestationの場合に証明書から導出された認証器ID(シリアル番号など)。