nacl_win 0.1.0 copy "nacl_win: ^0.1.0" to clipboard
nacl_win: ^0.1.0 copied to clipboard

A flutter plugin for Windows for generating Ed25519 keys and signing messages.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:nacl_win/nacl_win.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String signature = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String sig;
    var key = await NaclWin.generateKey();
    sig = await NaclWin.signMessage('message', key.privKey);

    setState(() {
      signature = sig;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Signature: $signature\n'),
        ),
      ),
    );
  }
}
0
likes
100
points
79
downloads

Publisher

verified publisherhumancolossus.org

Weekly Downloads

A flutter plugin for Windows for generating Ed25519 keys and signing messages.

Repository (GitHub)
View/report issues

Documentation

API reference

License

EUPL-1.2 (license)

Dependencies

ffi, flutter, flutter_rust_bridge, meta, plugin_platform_interface

More

Packages that depend on nacl_win