certificate_transparency_plugin 1.0.2 copy "certificate_transparency_plugin: ^1.0.2" to clipboard
certificate_transparency_plugin: ^1.0.2 copied to clipboard

PlatformAndroid

A plugin to check Certificate Transparency using OkHttp and CTLogger.

example/lib/main.dart

import 'dart:convert';

import 'package:certificate_transparency_plugin/certificate_transparency_plugin.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: CertificateTransparencyTestPage(),
    );
  }
}

class CertificateTransparencyTestPage extends StatefulWidget {
  const CertificateTransparencyTestPage({super.key});

  @override
  CertificateTransparencyTestPageState createState() =>
      CertificateTransparencyTestPageState();
}

class CertificateTransparencyTestPageState
    extends State<CertificateTransparencyTestPage> {
  String result = "Tap to check";
  Future<void> _checkCT() async {
    final response = await CertificateTransparency.verifyUrl(
        "https://www.google.com",
        includeHosts: ["google.com"],
        excludeHosts: []);
    setState(() {
      result = response.toString();
    });
    if (kDebugMode) {
      print(const JsonEncoder.withIndent('   ').convert(result));
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Center(child: Text("CT Test"))),
      body: SingleChildScrollView(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Padding(
                padding: const EdgeInsets.all(10.0),
                child: Text(result),
              ),
              ElevatedButton(
                onPressed: _checkCT,
                child: const Text("Verify CT"),
              )
            ],
          ),
        ),
      ),
    );
  }
}
5
likes
140
points
40
downloads

Publisher

unverified uploader

Weekly Downloads

A plugin to check Certificate Transparency using OkHttp and CTLogger.

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on certificate_transparency_plugin