SslPinningClient class

Creates SecurityContext and HttpClient with pinned certificates.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

debugFetchOverride Future<Uint8List> Function(RemoteCertificateConfig config)?
Override for the download request in tests.
getter/setter pair

Static Methods

cachedPem(SslPinningConfig config) Uint8List?
Resolved PEM bytes for a local config, or null if it hasn't been initialized yet. Forward to the reporter's pinnedCertPem to reuse the same cert without a second load.
cachedRemotePem(RemoteCertificateConfig config) Uint8List?
Resolved PEM bytes for a remote config, or null if downloadCertificate hasn't succeeded yet.
clearRemoteCertificate(RemoteCertificateConfig config) Future<void>
Removes the stored remote certificate for config and evicts it from the memory cache.
createContext(SslPinningConfig config, {AssetBundle? bundle}) Future<SecurityContext>
Builds a SecurityContext pinned to the local certificates in config, plain PEM or encrypted .enc (with passphrase).
createHttpClient(SslPinningConfig config, {AssetBundle? bundle}) Future<HttpClient>
createContext wrapped in an HttpClient.
createRemoteContext(RemoteCertificateConfig config) SecurityContext
Synchronously builds a SecurityContext pinned to the certificate previously obtained with downloadCertificate.
createRemoteHttpClient(RemoteCertificateConfig config) HttpClient
createRemoteContext wrapped in an HttpClient.
downloadCertificate(RemoteCertificateConfig config) Future<bool>
Downloads the certificate from RemoteCertificateConfig.url, validates it (plain or encrypted, per passphrase), and always replaces the stored copy.
invalidateCache() → void
Clears every in-memory context and PEM. Stored remote certificates are kept; use clearRemoteCertificate to delete them.
validatePem(Uint8List bytes) → void