Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. RTCCertificateStats

RTCCertificateStats

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

TheRTCCertificateStats dictionary of theWebRTC API is used to report information about a certificate used by anRTCDtlsTransport and its underlyingRTCIceTransport.

The report can be obtained by iterating theRTCStatsReport returned byRTCPeerConnection.getStats() until you find an entry with thetype ofcertificate.

Instance properties

fingerprint

A string containing the certificate fingerprint, which is calculated using the hash function specified infingerprintAlgorithm.

fingerprintAlgorithm

A string containing the hash function used to compute the certificatefingerprint, such as "sha-256".

base64Certificate

A string containing the base-64 representation of the DER-encoded certificate.

Common instance properties

The following properties are common to all WebRTC statistics objects (SeeRTCStatsReport for more information).

id

A string that uniquely identifies the object that is being monitored to produce this set of statistics.

timestamp

ADOMHighResTimeStamp object indicating the time at which the sample was taken for this statistics object.

type

A string with the value"certificate", indicating the type of statistics that the object contains.

Examples

Given a variablemyPeerConnection, which is an instance ofRTCPeerConnection, the code below usesawait to wait for the statistics report, and then iterates it usingRTCStatsReport.forEach().It then filters the dictionaries for just those reports that have the type ofcertificate and logs the result.

js
const stats = await myPeerConnection.getStats();stats.forEach((report) => {  if (report.type === "certificate") {    // Log the certificate information    console.log(report);  }});

Specifications

Specification
Identifiers for WebRTC's Statistics API
# dom-rtcstatstype-certificate

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp