LEFT | RIGHT |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """The FileVault Drive Encryption (FVDE) path specification implementation.""" | 2 """The FileVault Drive Encryption (FVDE) path specification implementation.""" |
3 | 3 |
4 from __future__ import unicode_literals | 4 from __future__ import unicode_literals |
5 | 5 |
6 from dfvfs.lib import definitions | 6 from dfvfs.lib import definitions |
7 from dfvfs.path import factory | 7 from dfvfs.path import factory |
8 from dfvfs.path import path_spec | 8 from dfvfs.path import path_spec |
9 | 9 |
10 | 10 |
11 class FVDEPathSpec(path_spec.PathSpec): | 11 class FVDEPathSpec(path_spec.PathSpec): |
12 """FVDE path specification. | 12 """FVDE path specification. |
13 | 13 |
14 Attributes: | 14 Attributes: |
15 encrypted_root_plist (str): path to the EncryptedRoot.plist.wipekey file. | 15 encrypted_root_plist (str): path to the EncryptedRoot.plist.wipekey file. |
16 password (str): password. | 16 password (str): password. |
17 recovery_password (str): recovery password. | 17 recovery_password (str): recovery password. |
18 """ | 18 """ |
19 | 19 |
20 TYPE_INDICATOR = definitions.TYPE_INDICATOR_FVDE | 20 TYPE_INDICATOR = definitions.TYPE_INDICATOR_FVDE |
21 | 21 |
22 def __init__( | 22 def __init__( |
23 self, encrypted_root_plist=None, password=None, parent=None, | 23 self, encrypted_root_plist=None, password=None, parent=None, |
24 recovery_password=None, **kwargs): | 24 recovery_password=None, **kwargs): |
25 """Initializes the path specification. | 25 """Initializes a path specification. |
26 | 26 |
27 Note that the FVDE path specification must have a parent. | 27 Note that the FVDE path specification must have a parent. |
28 | 28 |
29 Args: | 29 Args: |
30 encrypted_root_plist (Optionla[str]): path to the | 30 encrypted_root_plist (Optionla[str]): path to the |
31 EncryptedRoot.plist.wipekey file. | 31 EncryptedRoot.plist.wipekey file. |
32 password (Optional[str]): password. | 32 password (Optional[str]): password. |
33 parent (Optional[PathSpec]): parent path specification. | 33 parent (Optional[PathSpec]): parent path specification. |
34 recovery_password (Optional[str]): recovery password. | 34 recovery_password (Optional[str]): recovery password. |
35 | 35 |
(...skipping 20 matching lines...) Expand all Loading... |
56 string_parts.append('password: {0:s}'.format(self.password)) | 56 string_parts.append('password: {0:s}'.format(self.password)) |
57 if self.recovery_password: | 57 if self.recovery_password: |
58 string_parts.append('recovery_password: {0:s}'.format( | 58 string_parts.append('recovery_password: {0:s}'.format( |
59 self.recovery_password)) | 59 self.recovery_password)) |
60 | 60 |
61 return self._GetComparable(sub_comparable_string=', '.join(string_parts)) | 61 return self._GetComparable(sub_comparable_string=', '.join(string_parts)) |
62 | 62 |
63 | 63 |
64 # Register the path specification with the factory. | 64 # Register the path specification with the factory. |
65 factory.Factory.RegisterPathSpec(FVDEPathSpec) | 65 factory.Factory.RegisterPathSpec(FVDEPathSpec) |
LEFT | RIGHT |