Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jerson committed Nov 30, 2024
1 parent 662d08a commit 777acdb
Show file tree
Hide file tree
Showing 20 changed files with 245 additions and 337 deletions.
301 changes: 150 additions & 151 deletions example/integration_test/app_test.dart

Large diffs are not rendered by default.

13 changes: 3 additions & 10 deletions example/lib/base64.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
import 'dart:typed_data';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:fast_rsa/fast_rsa.dart';

import 'package:fast_rsa_example/main.dart';
import 'package:fast_rsa_example/shared/button_widget.dart';
import 'package:fast_rsa_example/shared/input_widget.dart';
import 'package:fast_rsa_example/shared/title_widget.dart';

class Base64 extends StatefulWidget {
const Base64({
Key? key,
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair,
super(key: key);
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand All @@ -38,7 +31,7 @@ class _Base64State extends State<Base64> {
TitleWidget(widget.title),
InputWidget(
title: "Encode",
key: Key("encode"),
key: const Key("encode"),
result: _encrypted,
onPressed: (controller) async {
var encrypted = await RSA.base64(
Expand Down
16 changes: 4 additions & 12 deletions example/lib/convert_jwt.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
import 'dart:convert';
import 'dart:typed_data';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:fast_rsa/fast_rsa.dart';

import 'package:fast_rsa_example/main.dart';
import 'package:fast_rsa_example/shared/button_widget.dart';
import 'package:fast_rsa_example/shared/input_widget.dart';
import 'package:fast_rsa_example/shared/title_widget.dart';

class ConvertJWT extends StatefulWidget {
const ConvertJWT({
Key? key,
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair,
super(key: key);
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand Down Expand Up @@ -45,7 +37,7 @@ class _ConvertJWTState extends State<ConvertJWT> {
TitleWidget(widget.title),
ButtonWidget(
title: "To PrivateKey",
key: Key("private"),
key: const Key("private"),
result: _private,
onPressed: () async {
var converted = await RSA.convertPrivateKeyToJWK(
Expand All @@ -59,7 +51,7 @@ class _ConvertJWTState extends State<ConvertJWT> {
),
ButtonWidget(
title: "To PublicKey",
key: Key("public"),
key: const Key("public"),
result: _public,
onPressed: () async {
var converted = await RSA.convertPublicKeyToJWK(
Expand Down
13 changes: 3 additions & 10 deletions example/lib/convert_keypair.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
import 'dart:convert';
import 'dart:typed_data';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:fast_rsa/fast_rsa.dart';

import 'package:fast_rsa_example/main.dart';
import 'package:fast_rsa_example/shared/button_widget.dart';
import 'package:fast_rsa_example/shared/input_widget.dart';
import 'package:fast_rsa_example/shared/title_widget.dart';

class ConvertKeyPair extends StatefulWidget {
const ConvertKeyPair({
Key? key,
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair,
super(key: key);
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand All @@ -44,7 +37,7 @@ class _ConvertKeyPairState extends State<ConvertKeyPair> {
TitleWidget(widget.title),
ButtonWidget(
title: "To PKCS12",
key: Key("pkcs12"),
key: const Key("pkcs12"),
result: _pkcs12,
onPressed: () async {
var result = await RSA.convertKeyPairToPKCS12(
Expand Down
18 changes: 6 additions & 12 deletions example/lib/convert_private.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
import 'dart:convert';
import 'dart:typed_data';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:fast_rsa/fast_rsa.dart';

import 'package:fast_rsa_example/main.dart';
import 'package:fast_rsa_example/shared/button_widget.dart';
import 'package:fast_rsa_example/shared/input_widget.dart';
import 'package:fast_rsa_example/shared/title_widget.dart';

class ConvertPrivate extends StatefulWidget {
const ConvertPrivate({
Key? key,
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair,
super(key: key);
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand All @@ -42,7 +36,7 @@ class _ConvertPrivateState extends State<ConvertPrivate> {
TitleWidget(widget.title),
ButtonWidget(
title: "To JWT",
key: Key("jwt"),
key: const Key("jwt"),
result: _jwt,
onPressed: () async {
var result = await RSA.convertPrivateKeyToJWK(
Expand All @@ -55,7 +49,7 @@ class _ConvertPrivateState extends State<ConvertPrivate> {
),
ButtonWidget(
title: "To PKCS1",
key: Key("pkcs1"),
key: const Key("pkcs1"),
result: _pkcs1,
onPressed: () async {
var result = await RSA.convertPrivateKeyToPKCS1(
Expand All @@ -68,7 +62,7 @@ class _ConvertPrivateState extends State<ConvertPrivate> {
),
ButtonWidget(
title: "To PKCS8",
key: Key("pkcs8"),
key: const Key("pkcs8"),
result: _pkcs8,
onPressed: () async {
var result = await RSA.convertPrivateKeyToPKCS8(
Expand All @@ -81,7 +75,7 @@ class _ConvertPrivateState extends State<ConvertPrivate> {
),
ButtonWidget(
title: "To PublicKey",
key: Key("public-key"),
key: const Key("public-key"),
result: _publicKey,
onPressed: () async {
var result = await RSA.convertPrivateKeyToPublicKey(
Expand Down
16 changes: 5 additions & 11 deletions example/lib/convert_public.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
import 'dart:convert';
import 'dart:typed_data';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:fast_rsa/fast_rsa.dart';

import 'package:fast_rsa_example/main.dart';
import 'package:fast_rsa_example/shared/button_widget.dart';
import 'package:fast_rsa_example/shared/input_widget.dart';
import 'package:fast_rsa_example/shared/title_widget.dart';

class ConvertPublic extends StatefulWidget {
const ConvertPublic({
Key? key,
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair,
super(key: key);
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand All @@ -41,7 +35,7 @@ class _ConvertPublicState extends State<ConvertPublic> {
TitleWidget(widget.title),
ButtonWidget(
title: "To JWT",
key: Key("jwt"),
key: const Key("jwt"),
result: _jwt,
onPressed: () async {
var result = await RSA.convertPublicKeyToJWK(
Expand All @@ -54,7 +48,7 @@ class _ConvertPublicState extends State<ConvertPublic> {
),
ButtonWidget(
title: "To PKCS1",
key: Key("pkcs1"),
key: const Key("pkcs1"),
result: _pkcs1,
onPressed: () async {
var result = await RSA.convertPublicKeyToPKCS1(
Expand All @@ -67,7 +61,7 @@ class _ConvertPublicState extends State<ConvertPublic> {
),
ButtonWidget(
title: "To PKIX",
key: Key("pkix"),
key: const Key("pkix"),
result: _pkix,
onPressed: () async {
var result = await RSA.convertPublicKeyToPKIX(
Expand Down
14 changes: 4 additions & 10 deletions example/lib/encrypt_decrypt_oaep.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import 'dart:typed_data';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:fast_rsa/fast_rsa.dart';

import 'package:fast_rsa_example/main.dart';
import 'package:fast_rsa_example/shared/button_widget.dart';
import 'package:fast_rsa_example/shared/input_widget.dart';
import 'package:fast_rsa_example/shared/title_widget.dart';

class EncryptAndDecryptOAEP extends StatefulWidget {
const EncryptAndDecryptOAEP({
Key? key,
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair,
super(key: key);
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand All @@ -39,7 +33,7 @@ class _EncryptAndDecryptOAEPState extends State<EncryptAndDecryptOAEP> {
TitleWidget(widget.title),
InputWidget(
title: "Encrypt",
key: Key("encrypt"),
key: const Key("encrypt"),
result: _encrypted,
onPressed: (controller) async {
var encrypted = await RSA.encryptOAEP(
Expand All @@ -55,7 +49,7 @@ class _EncryptAndDecryptOAEPState extends State<EncryptAndDecryptOAEP> {
),
ButtonWidget(
title: "Decrypt",
key: Key("decrypt"),
key: const Key("decrypt"),
result: _decrypted,
onPressed: () async {
var decrypted = await RSA.decryptOAEP(
Expand Down
12 changes: 4 additions & 8 deletions example/lib/encrypt_decrypt_oaep_bytes.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
import 'dart:convert';
import 'dart:typed_data';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:fast_rsa/fast_rsa.dart';

import 'package:fast_rsa_example/main.dart';
import 'package:fast_rsa_example/shared/button_widget.dart';
import 'package:fast_rsa_example/shared/input_widget.dart';
import 'package:fast_rsa_example/shared/title_widget.dart';

class EncryptAndDecryptOAEPBytes extends StatefulWidget {
const EncryptAndDecryptOAEPBytes({
Key? key,
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair,
super(key: key);
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand All @@ -42,7 +38,7 @@ class _EncryptAndDecryptOAEPBytesState
TitleWidget(widget.title),
InputWidget(
title: "Encrypt",
key: Key("encrypt"),
key: const Key("encrypt"),
result: _encrypted,
onPressed: (controller) async {
var encrypted = await RSA.encryptOAEPBytes(
Expand All @@ -58,7 +54,7 @@ class _EncryptAndDecryptOAEPBytesState
),
ButtonWidget(
title: "Decrypt",
key: Key("decrypt"),
key: const Key("decrypt"),
result: _decrypted,
onPressed: () async {
var decrypted = await RSA.decryptOAEPBytes(
Expand Down
14 changes: 4 additions & 10 deletions example/lib/encrypt_decrypt_pkcs.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import 'dart:typed_data';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:fast_rsa/fast_rsa.dart';

import 'package:fast_rsa_example/main.dart';
import 'package:fast_rsa_example/shared/button_widget.dart';
import 'package:fast_rsa_example/shared/input_widget.dart';
import 'package:fast_rsa_example/shared/title_widget.dart';

class EncryptAndDecryptPKCS extends StatefulWidget {
const EncryptAndDecryptPKCS({
Key? key,
super.key,
required this.title,
required PKCS12KeyPair keyPair,
}) : keyPair = keyPair,
super(key: key);
}) : keyPair = keyPair;

final PKCS12KeyPair keyPair;
final String title;
Expand All @@ -39,7 +33,7 @@ class _EncryptAndDecryptPKCSState extends State<EncryptAndDecryptPKCS> {
TitleWidget(widget.title),
InputWidget(
title: "Encrypt",
key: Key("encrypt"),
key: const Key("encrypt"),
result: _encrypted,
onPressed: (controller) async {
var encrypted = await RSA.encryptPKCS1v15(
Expand All @@ -53,7 +47,7 @@ class _EncryptAndDecryptPKCSState extends State<EncryptAndDecryptPKCS> {
),
ButtonWidget(
title: "Decrypt",
key: Key("decrypt"),
key: const Key("decrypt"),
result: _decrypted,
onPressed: () async {
var decrypted = await RSA.decryptPKCS1v15(
Expand Down
Loading

0 comments on commit 777acdb

Please sign in to comment.