rsa_digitalsignature 1.0.5 copy "rsa_digitalsignature: ^1.0.5" to clipboard
rsa_digitalsignature: ^1.0.5 copied to clipboard

A plugin for signing data with privateKey RSACNG for windows & MacOS.

RSA Digital Signature #

Library for SignData use RSACNG privateKey with support for macos, windows Retrieve Certificates Sign Data Data signed

Usage #

Retreive all certificate has NonRepudiation KeyUsage #

import 'package:rsa_digitalsignature/rsa_digitalsignature.dart';
import 'package:rsa_digitalsignature/certificate.dart';

final RsaDigitalsignature _rsaDigitalSignaturePlugin =RsaDigitalsignature();

final List<Certificate> _certificates = await _rsaDigitalSignaturePlugin.getCertifications();

SignData With PrivateKey #


final String message = "Hello World !";
final Uint8List dataToSign = Uint8List.fromList(utf8.encode(message));
final Digest hash = sha256.convert(dataToSign);
final dynamic publickey = await _rsaDigitalSignaturePlugin.signWithprivatekey((hash.bytes as Uint8List), _selectedCertificate!.publickey);
Uint8List datasigned = Uint8List.fromList(List<int>.from(publickey as List<dynamic>));

Cerificate Class #

class Certificate {
  final Uint8List publickey; <-- DER Certificate
  final X509Certificate x509certificate; <-- X509 Instance
  final String cn; <-- Common Name
  const Certificate(
      {required this.publickey,
      required this.x509certificate,
      required this.cn});
}

Setup #

Windows #

No additional setup required.

MacOS #

No additional setup required.

Example #

Inside example folder

cd example && flutter run
1
likes
80
pub points
27%
popularity

Publisher

unverified uploader

A plugin for signing data with privateKey RSACNG for windows & MacOS.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

asn1lib, flutter, plugin_platform_interface, x509

More

Packages that depend on rsa_digitalsignature