1
1
import 'dart:convert' ;
2
- import 'dart:typed_data' ;
3
2
4
- import 'package:flutter/foundation.dart' ;
5
3
import 'package:flutter/material.dart' ;
6
- import 'package:flutter/widgets.dart' ;
7
4
import 'package:fast_rsa/fast_rsa.dart' ;
8
5
9
- import 'package:fast_rsa_example/main.dart' ;
10
6
import 'package:fast_rsa_example/shared/button_widget.dart' ;
11
- import 'package:fast_rsa_example/shared/input_widget.dart' ;
12
7
import 'package:fast_rsa_example/shared/title_widget.dart' ;
13
8
14
9
class ConvertPrivate extends StatefulWidget {
15
10
const ConvertPrivate ({
16
- Key ? key,
11
+ super . key,
17
12
required this .title,
18
13
required PKCS12KeyPair keyPair,
19
- }) : keyPair = keyPair,
20
- super (key: key);
14
+ }) : keyPair = keyPair;
21
15
22
16
final PKCS12KeyPair keyPair;
23
17
final String title;
@@ -42,7 +36,7 @@ class _ConvertPrivateState extends State<ConvertPrivate> {
42
36
TitleWidget (widget.title),
43
37
ButtonWidget (
44
38
title: "To JWT" ,
45
- key: Key ("jwt" ),
39
+ key: const Key ("jwt" ),
46
40
result: _jwt,
47
41
onPressed: () async {
48
42
var result = await RSA .convertPrivateKeyToJWK (
@@ -55,7 +49,7 @@ class _ConvertPrivateState extends State<ConvertPrivate> {
55
49
),
56
50
ButtonWidget (
57
51
title: "To PKCS1" ,
58
- key: Key ("pkcs1" ),
52
+ key: const Key ("pkcs1" ),
59
53
result: _pkcs1,
60
54
onPressed: () async {
61
55
var result = await RSA .convertPrivateKeyToPKCS1 (
@@ -68,7 +62,7 @@ class _ConvertPrivateState extends State<ConvertPrivate> {
68
62
),
69
63
ButtonWidget (
70
64
title: "To PKCS8" ,
71
- key: Key ("pkcs8" ),
65
+ key: const Key ("pkcs8" ),
72
66
result: _pkcs8,
73
67
onPressed: () async {
74
68
var result = await RSA .convertPrivateKeyToPKCS8 (
@@ -81,7 +75,7 @@ class _ConvertPrivateState extends State<ConvertPrivate> {
81
75
),
82
76
ButtonWidget (
83
77
title: "To PublicKey" ,
84
- key: Key ("public-key" ),
78
+ key: const Key ("public-key" ),
85
79
result: _publicKey,
86
80
onPressed: () async {
87
81
var result = await RSA .convertPrivateKeyToPublicKey (
0 commit comments