@@ -18,6 +18,14 @@ A comprehensive React demo application showcasing the complete functionality of
1818- ** Encryption/Decryption** : AES encrypt and decrypt sensitive data
1919- ** Address Operations** : Get addresses from public keys
2020
21+ ### 🔐 KeyStore Management
22+ - ** KeyStore Generation** : Create encrypted keyStore files from wallet data
23+ - ** KeyStore Import/Export** : Import and export keyStore JSON files
24+ - ** Password Protection** : Secure wallet data with password-based encryption
25+ - ** Multiple Cipher Support** : Support for various AES encryption modes
26+ - ** KeyStore Unlocking** : Decrypt and unlock keyStore files with passwords
27+ - ** Password Validation** : Check if passwords are correct for keyStore files
28+
2129### 📋 Contract Operations
2230- ** Contract Initialization** : Initialize and interact with smart contracts
2331- ** Token Operations** : Get token information, balances, and perform transfers
5058├── components/
5159│ ├── Chain.jsx # Chain operations component
5260│ ├── Wallet.jsx # Wallet management component
61+ │ ├── KeyStore.jsx # KeyStore management component
5362│ ├── contract.jsx # Contract operations component
5463│ ├── Transaction.jsx # Transaction management component
5564│ └── Utils.jsx # Utils operations component
@@ -94,19 +103,26 @@ Navigate to `http://localhost:5173`
94103- Encrypt/decrypt sensitive data
95104- View wallet information and addresses
96105
97- ### 3. Contract Operations Tab
106+ ### 3. KeyStore Management Tab
107+ - Generate encrypted keyStore files from wallet data
108+ - Import and export keyStore JSON files
109+ - Test password protection and validation
110+ - Unlock keyStore files with passwords
111+ - Support for multiple AES encryption modes
112+
113+ ### 4. Contract Operations Tab
98114- Initialize token contracts
99115- Get token information and balances
100116- Perform transfers and approvals
101117- Query contract methods and parameters
102118
103- ### 4 . Transaction Management Tab
119+ ### 5 . Transaction Management Tab
104120- Create custom transactions
105121- Sign and broadcast transactions
106122- Track transaction status and results
107123- Query blocks and merkle paths
108124
109- ### 5 . Utils Operations Tab
125+ ### 6 . Utils Operations Tab
110126- Test hash functions and encoding
111127- Perform string operations and conversions
112128- Handle BigNumber operations
@@ -205,6 +221,28 @@ const result = await tokenContract.Transfer.sendTransaction({
205221console .log (' Transaction ID:' , result .TransactionId );
206222```
207223
224+ ### KeyStore Generation and Unlocking
225+ ``` javascript
226+ // Generate keyStore
227+ const walletData = {
228+ mnemonic: wallet .mnemonic ,
229+ privateKey: wallet .privateKey ,
230+ nickName: ' My Wallet' ,
231+ address: wallet .address
232+ };
233+ const keyStore = AElf .utils .keyStore .getKeystore (walletData, ' password123' , {
234+ cipher: ' aes-256-cbc'
235+ });
236+
237+ // Unlock keyStore
238+ const unlocked = AElf .utils .keyStore .unlockKeystore (keyStore, ' password123' );
239+ console .log (' Unlocked private key:' , unlocked .privateKey );
240+
241+ // Check password
242+ const isValid = AElf .utils .keyStore .checkPassword (keyStore, ' password123' );
243+ console .log (' Password valid:' , isValid);
244+ ```
245+
208246## 🚨 Important Notes
209247
210248- ** Test Environment** : This demo uses test networks and test private keys
0 commit comments