Skip to content

Commit fbeda93

Browse files
authored
Add function details in readme
1 parent 9ddaa8c commit fbeda93

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff 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
1414
This function is used to get the RSA public key which is store the android and ios key store.
1515
This 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
2026
final String rsaPublicKey = await Cipher.getPublicKey();
2127
```
2228

23-
### sign
29+
### 2) sign
2430
This 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
3343
This function returns a boolean, and takes a plain data and signature.
3444

3545
This 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+
3753
usage:
3854
```dart
3955
final bool result = await Cipher.verify('somePassword', 'SIGNATURE-XX');

0 commit comments

Comments
 (0)