Skip to content

Permanent Certificates

benny daon edited this page Jun 6, 2021 · 3 revisions

Motivation

The need arose in peerbook signaling server. Users of peerbook have a address book of peers. For each peer it stores it's fingerprint, owner and and is it verified. The fingerprint can't be ephemeral has it's the peer's ID.

Browser Implementation

In the browser storing & loading a certificate is done using RTCCertificate and IndexedDB. IndexedDB has a complicated interface, an alternative is (idvb)[https://www.npmjs.com/package/idb] and open source library that adds promises and lessens the pain/

In Pion

To support this feature pion supports PEM serialization. Certificate has a PEM() method returning a string with two PEM blocks CERTIFICATE & PRIVATE KEY.

It is up to the user to store this string is a secure manner. To load a certificate from this string user webrtc.CertificateFromPEM() function.