--- title: PublicKeyCredential.rawId slug: Web/API/PublicKeyCredential/rawId tags: - API - Property - PublicKeyCredential - Reference - Web Authentication API - WebAuthn - プロパティ translation_of: Web/API/PublicKeyCredential/rawId --- <div>{{APIRef("Web Authentication API")}}{{securecontext_header}}</div> <p><strong><code>rawId</code></strong> は {{domxref("PublicKeyCredential")}} インターフェイスの読み取り専用プロパティで、証明書の識別子が入った {{jsxref("ArrayBuffer")}} オブジェクトです。</p> <p>{{domxref("PublicKeyCredential.id")}} プロパティはこの識別子が <a href="/ja/docs/Web/API/WindowBase64/Base64_encoding_and_decoding">base64url エンコード</a>されたものです。</p> <div class="note"> <p><strong>メモ:</strong> このプロパティは最上位のコンテキストでしか使えない可能性があり、例えば {{HTMLElement("iframe")}} の中では利用できません。</p> </div> <h2 id="Syntax" name="Syntax">構文</h2> <pre class="syntaxbox"><var>rawId</var> = <var>publicKeyCredential</var>.rawId</pre> <h3 id="Value" name="Value">値</h3> <p>{{jsxref("ArrayBuffer")}} で、証明書の識別子が入っています。この識別子はグローバルに固有で、現在の <code>PublicKeyCredential</code> および関連する {{domxref("AuthenticatorAssertionResponse")}} を指しています。</p> <h2 id="Examples" name="Examples">例</h2> <pre class="brush: js">var options = { challenge: new Uint8Array(26) /* from the server */, rp: { name: "Example CORP", id : "login.example.com" }, user: { id: new Uint8Array(26), /* To be changed for each user */ name: "jdoe@example.com", displayName: "John Doe", }, pubKeyCredParams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey: options }) .then(function (pubKeyCredential) { var rawId = pubKeyCredential.rawId; // Do something with rawId }).catch(function (err) { // Deal with any error }); </pre> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('WebAuthn','#dom-publickeycredential-rawid','rawId')}}</td> <td>{{Spec2('WebAuthn')}}</td> <td>初回定義</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2> <p>{{Compat("api.PublicKeyCredential.rawId")}}</p>