openpgp 0.9.0 copy "openpgp: ^0.9.0" to clipboard
openpgp: ^0.9.0 copied to clipboard

outdated

library for use OpenPGP with support for android and ios, macOS, linux, web and hover

OpenPGP #

Library for use openPGP with support for android, ios, macos, linux, web and hover

Contents #

Usage #

import 'package:openpgp/key_options.dart';
import 'package:openpgp/key_pair.dart';
import 'package:openpgp/openpgp.dart';
import 'package:openpgp/options.dart';

var keyPair = await OpenPGP.generate(
      options: Options(
        name: 'test',
        comment: 'test',
        email: 'test@test.com',
        passphrase: "123456",
        keyOptions: KeyOptions(
            rsaBits: 2048,
            cipher: Cypher.aes128,
            compression: Compression.none,
            hash: Hash.sha256,
            compressionLevel: 0,
        ),
      ),
);


var encrypted = await OpenPGP.encrypt("text","[publicKey here]");

var decrypted = await OpenPGP.decrypt("text encrypted","[privateKey here]","[passphrase here]");

var signed = await OpenPGP.sign("text","[publicKey here]","[privateKey here]","[passphrase here]");

var verified = await OpenPGP.verify("text signed","text","[publicKey here]");

var encryptedSymmetric = await OpenPGP.encryptSymmetric("text","[passphrase here]");

var decryptedSymmetric = await OpenPGP.decryptSymmetric("text encrypted","[passphrase here]");

Setup #

Android #

ProGuard

Add this lines to android/app/proguard-rules.pro for proguard support

-keep class go.** { *; }
-keep class openpgp.** { *; }

iOS #

no additional setup required

Web #

add to you pubspec.yaml

assets:
  - packages/openpgp/web/assets/wasm_exec.js
  - packages/openpgp/web/assets/openpgp.wasm

ref: https://github.com/jerson/flutter-openpgp/blob/master/example/pubspec.yaml

and in you web/index.html

<script
  src="assets/packages/openpgp/web/assets/wasm_exec.js"
  type="application/javascript"
></script>

ref: https://github.com/jerson/flutter-openpgp/blob/master/example/web/index.html

Linux #

add to you linux/app_configuration.mk

EXTRA_LDFLAGS=-lopenpgp

ref: https://github.com/jerson/flutter-openpgp/blob/master/example/linux/app_configuration.mk

MacOS #

no additional setup required

Hover #

just update your plugins

hover plugins get

Example #

Inside example folder

cd example && flutter run

Native Code #

the native library is made in Golang and build with gomobile for faster performance

https://github.com/jerson/openpgp-mobile

37
likes
0
pub points
88%
popularity

Publisher

verified publisherjerson.dev

library for use OpenPGP with support for android and ios, macOS, linux, web and hover

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_web_plugins, js

More

Packages that depend on openpgp