verifyPeerCertificate method
Verifies the peer's certificate using the libp2p TLS extension.
certBytes is the raw DER-encoded X.509 certificate received from the
peer during the TLS handshake. The bytes are captured during the
handshake but are not validated until this method is called.
When expectedPeerId is provided, the derived peer identity must match
it.
Returns true if the certificate contains the libp2p extension, the
signature is valid, and the derived peer identity matches
expectedPeerId (when given).
Implementation
Future<bool> verifyPeerCertificate(
List<int> certBytes, {
quic_lib.PeerId? expectedPeerId,
}) async {
final backend = quic_lib.DefaultCryptoBackend();
return _delegate.verifyPeerCertificate(
certBytes,
expectedPeerId: expectedPeerId,
backend: backend,
);
}