| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -39,6 +39,15 @@ void main() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }); | 
					 | 
					 | 
					 | 
					  }); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  group('Composite key', () { | 
					 | 
					 | 
					 | 
					  group('Composite key', () { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    Future<KdbxFile> readFile( | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        String kdbxFile, String password, String keyFile) async { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      final keyFileBytes = await File(keyFile).readAsBytes(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      final cred = Credentials.composite( | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          ProtectedValue.fromString(password), keyFileBytes); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      final data = await File(kdbxFile).readAsBytes(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      return await kdbxFormat.read(data, cred); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    test('Read with PW and keyfile', () async { | 
					 | 
					 | 
					 | 
					    test('Read with PW and keyfile', () async { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      final keyFileBytes = | 
					 | 
					 | 
					 | 
					      final keyFileBytes = | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          await File('test/password-and-keyfile.key').readAsBytes(); | 
					 | 
					 | 
					 | 
					          await File('test/password-and-keyfile.key').readAsBytes(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -49,14 +58,15 @@ void main() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      expect(file.body.rootGroup.entries, hasLength(2)); | 
					 | 
					 | 
					 | 
					      expect(file.body.rootGroup.entries, hasLength(2)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }); | 
					 | 
					 | 
					 | 
					    }); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    test('Read with PW and hex keyfile', () async { | 
					 | 
					 | 
					 | 
					    test('Read with PW and hex keyfile', () async { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      final keyFileBytes = | 
					 | 
					 | 
					 | 
					      final file = await readFile('test/keyfile/newdatabase2.kdbx', 'testing99', | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          await File('test/keyfile/hexkey_no_newline').readAsBytes(); | 
					 | 
					 | 
					 | 
					          'test/keyfile/hexkey_no_newline'); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      final cred = Credentials.composite( | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          ProtectedValue.fromString('testing99'), keyFileBytes); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      final data = await File('test/keyfile/newdatabase2.kdbx').readAsBytes(); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      final file = await kdbxFormat.read(data, cred); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      expect(file.body.rootGroup.entries, hasLength(3)); | 
					 | 
					 | 
					 | 
					      expect(file.body.rootGroup.entries, hasLength(3)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }); | 
					 | 
					 | 
					 | 
					    }); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    test('Keyfile v2 with PW and keyfile', () async { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      final file = await readFile( | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          'test/keyfile/keyfilev2.kdbx', 'qwe', 'test/keyfile/keyfilev2.keyx'); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      expect(file.body.rootGroup.entries, hasLength(2)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    }); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  }); | 
					 | 
					 | 
					 | 
					  }); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  group('Creating', () { | 
					 | 
					 | 
					 | 
					  group('Creating', () { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |