secure_pinning_http 0.0.2 copy "secure_pinning_http: ^0.0.2" to clipboard
secure_pinning_http: ^0.0.2 copied to clipboard

package:http integration for secure_pinning — a BaseClient wrapper with full verb + streaming support, built on secure_pinning's pure-Dart pinning engine.

secure_pinning_http #

package:http integration for secure_pinning — a BaseClient wrapper with full verb and streaming support, built on secure_pinning's pure-Dart pinning engine.

Usage #

import 'package:secure_pinning_http/secure_pinning_http.dart';

final client = SecurePinningHttpClient.forHost(
  'api.example.com',
  pins: ['hex-spki-hash-1', 'hex-spki-hash-2'], // include a backup pin
);
final response = await client.get(Uri.https('api.example.com', '/'));

SecurePinningHttpClient is a full http.BaseClientget, post, put, patch, delete, head, read, readBytes, and streaming via send() all work as usual, validated against the pinned connection.

For multi-host apps, backup-pin rotation, non-default hash algorithms, or migrating from a leaf-hash-based pinning setup, construct a full SecurePinningConfig instead of using .forHost():

import 'package:secure_pinning_http/secure_pinning_http.dart';

final client = SecurePinningHttpClient(
  SecurePinningConfig(
    host: 'api.example.com',
    pins: ['hex-spki-hash-1', 'hex-spki-hash-2'],
  ),
);

See secure_pinning for the full SecurePinningConfig/PinningMode API and the typed exception hierarchy thrown on a pinning failure.

0
likes
160
points
118
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

package:http integration for secure_pinning — a BaseClient wrapper with full verb + streaming support, built on secure_pinning's pure-Dart pinning engine.

Repository (GitHub)
View/report issues
Contributing

Topics

#security #networking #certificate-pinning #http

License

Apache-2.0 (license)

Dependencies

flutter, http, secure_pinning

More

Packages that depend on secure_pinning_http