RTCCertificate
DTLS certificates of a connection and the key algorithms to generate them with.
- class webrtc.models.rtc_certificate.RTCCertificateExpiration(expires=None)
The lifetime of a generated certificate. Itβs the base of
webrtc.Algorithm.See MDN: RTCPeerConnection/generateCertificate_static.
- Parameters:
expires (
int, optional) β In how many milliseconds the certificate expires, capped at a year. Itβs 30 days if omitted.
- class webrtc.models.rtc_certificate.Algorithm(name, *, expires=None)
A key algorithm by its WebCrypto name, for
webrtc.RTCPeerConnection.generate_certificate().'ECDSA'uses the P-256 curve.'RSASSA-PKCS1-v1_5'needs anwebrtc.RsaHashedKeyGenParamsinstead.
- class webrtc.models.rtc_certificate.EcKeyGenParams(name, named_curve, *, expires=None)
An ECDSA key algorithm with an explicit curve.
See MDN: EcKeyGenParams.
- class webrtc.models.rtc_certificate.RsaHashedKeyGenParams(name, *, modulus_length, public_exponent, hash, expires=None)
An RSA key algorithm. Every member but the name is keyword-only.
See MDN: RsaHashedKeyGenParams.
- Parameters:
name (
str) β'RSASSA-PKCS1-v1_5'.modulus_length (
int) β The length of the modulus in bits, like 2048.public_exponent (
bytes) β The public exponent, big-endian, likebytes([1, 0, 1])for 65537.hash (
strorwebrtc.Algorithm) β The hash function, of which only'SHA-256'is supported.expires (
int, optional) β In how many milliseconds the certificate expires.
- webrtc.models.rtc_certificate.AlgorithmIdentifier
A key algorithm, or its name (like
'ECDSA'), aswebrtc.RTCPeerConnection.generate_certificate()takes it
- class webrtc.models.rtc_certificate.RTCDtlsFingerprint(algorithm=None, value=None)
A fingerprint of a certificate, as the
a=fingerprintline of SDP carries it. Itβs immutable.
- class webrtc.models.rtc_certificate.RTCCertificate(native_obj=None)
A certificate and its private key, which a connection authenticates with in DTLS.
Only
webrtc.RTCPeerConnection.generate_certificate()creates it, and a connection uses it throughwebrtc.RTCConfiguration.certificates. A connection without one generates its own. See MDN: RTCCertificate.- property expires: float
When the certificate expires, in milliseconds since the Unix epoch.
A configuration with an expired certificate raises
webrtc.InvalidAccessError. See MDN: RTCCertificate/expires.- Type:
- get_fingerprints()
Returns the fingerprints of the certificate, as the remote peer sees them in the SDP.
See MDN: RTCCertificate/getFingerprints.
- Returns:
listofwebrtc.RTCDtlsFingerprintβ The fingerprints.- Return type: