RTCPeerConnection.generateCertificate()

RTCPeerConnection 인터페이스의 generateCertificate() 메소드는 X.509 인증서와 해당하는 개인 키를 생성하고 저장합니다. 그리고 접근이 가능한 RTCCertificate를 반환합니다.

Syntax

var cert = RTCPeerConnection.generateCertificate(keygenAlgorithm)

매개변수

keygenAlgorithm
키를 생성하는데 사용하는 알고리즘을 식별하는 DOMString입니다.

RTCPeerConnection.generateCertificate() 은 정적인 메소드로, 따라서 인스턴스가 아닌 RTCPeerConnection 인터페이스에서 항상 호출됩니다.

반환 값

RTCCertificate 객체에 대한 참조 값입니다.

예제

RTCPeerConnection.generateCertificate({
    name: 'RSASSA-PKCS1-v1_5',
    hash: 'SHA-256',
    modulusLength: 2048,
    publicExponent: new Uint8Array([1, 0, 1])
}).then(function(cert) {
  var pc = new RTCPeerConnection({certificates: [cert]});
});

명세

명세 상태 코멘트
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'generateCertificate()' in that specification.
Candidate Recommendation Initial definition.

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
generateCertificateChrome Full support 48Edge Full support YesFirefox Full support 22IE No support NoOpera Full support 43
Notes
Full support 43
Notes
Notes Promise-based version.
No support 37 — 43
Safari ? WebView Android Full support 48Chrome Android Full support 48Firefox Android Full support 44Opera Android Full support 43
Notes
Full support 43
Notes
Notes Promise-based version.
No support 37 — 43
Safari iOS ? Samsung Internet Android Full support 6.0

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.

참조