File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -10,30 +10,46 @@ This plugin exposes the following methods:
1010* ` encrypt ` : encrypts the plain text using private key from the key pair
1111* ` verify ` : verifies a signature and returns a boolean if the signature is signed by the same key pair.
1212
13- ### getPublicKey
13+ ### 1) getPublicKey
1414This function is used to get the RSA public key which is store the android and ios key store.
1515This key pair is persisted in key store, i.e it is generated once, and always re used for signing and verification.
1616
17- usage:
17+ #### defination
18+
19+ ``` dart
20+ static Future<String> getPublicKey()
21+
22+ ```
23+ #### usage:
1824
1925``` dart
2026final String rsaPublicKey = await Cipher.getPublicKey();
2127```
2228
23- ### sign
29+ ### 2) sign
2430This function returns a signature which is signed by the platoform's private key.
31+ #### defination
2532
26- usage:
2733``` dart
28- final String signature = await Cipher.sign('some plain data');
34+ static Future<String> sign(String plainData)
35+ ```
2936
37+ #### usage:
38+ ``` dart
39+ final String signature = await Cipher.sign('some plain data');
3040```
3141
32- ### verify
42+ ### 3) verify
3343This function returns a boolean, and takes a plain data and signature.
3444
3545This function verifies the signature against the plain data, it returns ` true ` if the signature is produced by the same device's private key.
3646
47+ #### defination
48+
49+ ``` dart
50+ static Future<bool> verify(String plainText, String signature)
51+ ```
52+
3753usage:
3854``` dart
3955final bool result = await Cipher.verify('somePassword', 'SIGNATURE-XX');
You can’t perform that action at this time.
0 commit comments