hs-libp2p-0.2.0.0: Haskell implementation of the libp2p networking stack
Safe HaskellNone
LanguageGHC2021

LibP2P.Transport.WebTransport.Certificate

Description

Short-lived certificates and certificate-hash verification for WebTransport. Browsers permit self-signed WebTransport certificates when a SHA-256 certificate hash is supplied out of band, but require a validity period of at most 14 days.

Synopsis

Documentation

newWebTransportCredential :: IO (Credential, ByteString) Source #

Generate a browser-acceptable short-lived Ed25519 certificate and return its SHA-256 multihash for use in a /certhash multiaddr.

verifyWebTransportCertificate :: [ByteString] -> CertificateChain -> IO (Either String ()) Source #

Verify a one-certificate WebTransport chain against any advertised SHA-256 multihash and enforce the browser certificate constraints.